AttnGAN β COCO (Xu et al., CVPR 2018)
The original AttnGAN COCO text-to-image model β AttnGAN: Fine-Grained Text to Image Generation
with Attentional Generative Adversarial Networks (Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han
Zhang, Zhe Gan, Xiaolei Huang, Xiaodong He). One of the landmark pre-diffusion text-to-image models:
a DAMSM text encoder feeds a 3-stage attentional generator (64β128β256) that attends to
individual words while drawing. Powers
mediasynthesismuseum/attngan-coco.
These are the original pretrained weights from taoxugit/AttnGAN (Google-Drive-hosted, mirrored here for preservation), runnable on modern PyTorch.
Files
coco_AttnGAN2.pthβ the 3-stage generatorG_NET(GF_DIM=48, R_NUM=3, Z_DIM=100).text_encoder100.pthβ the DAMSM bi-LSTMRNN_ENCODER(EMBEDDING_DIM=256).captions.pickleβ COCO caption metadata; providesixtoword/wordtoix(vocab 27,297).model.py,GlobalAttention.pyβ the network definitions.
Usage
cfg.GAN.GF_DIM=48; cfg.GAN.R_NUM=3; cfg.TREE.BRANCH_NUM=3 # COCO config
text_encoder = RNN_ENCODER(27297, nhidden=256); text_encoder.load_state_dict(torch.load("text_encoder100.pth"))
netG = G_NET(); netG.load_state_dict(torch.load("coco_AttnGAN2.pth"))
# tokenize caption via wordtoix -> text_encoder -> netG(noise, sent_emb, words_embs, mask)
# final image = fake_imgs[-1] (256x256, in [-1,1])
Output is impressionistic 256Γ256 (authentic to 2018) β it captures objects/scene/colour from the caption. Credit: the AttnGAN authors; built on StackGAN (Han Zhang et al.).