Views
No views yet

models/first_stage_models/vq-f16) to handle RGBA images by changing the input and output channels from 3 to 4. See our paper for more details.1cat <<EOF > requirements.txt
2transformers>=4.42.4
3omegaconf>=2.3.0
4einops>=0.8.0
5pillow>=10.4.0
6pytorch_lightning<2.0.0
7huggingface-hub>=0.24.0
8git+https://github.com/ktrk115/latent-diffusion.git@23d5a49
9git+https://github.com/illeatmyhat/taming-transformers.git@aeabaa3
10EOFpip install -r requirements.txt1import torch
2from PIL import Image
3from transformers import AutoImageProcessor, AutoModel
4
5image_processor = AutoImageProcessor.from_pretrained("cyberagent/ldm-vq-f16-rgba", trust_remote_code=True)
6model = AutoModel.from_pretrained("cyberagent/ldm-vq-f16-rgba", trust_remote_code=True)
7
8# Image reconstruction
9img = Image.open("path/to/image.png")
10example = image_processor(img)
11with torch.inference_mode():
12 recon, _ = model.model(example["image"].unsqueeze(0))
13recon_img = image_processor.postprocess(recon[0])
14recon_img.save("recon.png")1@inproceedings{Kikuchi2025,
2 title = {Multimodal Markup Document Models for Graphic Design Completion},
3 author = {Kotaro Kikuchi and Ukyo Honda and Naoto Inoue and Mayu Otani and Edgar Simo-Serra and Kota Yamaguchi},
4 booktitle = {ACM International Conference on Multimedia},
5 year = {2025},
6 doi = {10.1145/3746027.3755420}
7}