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 generator G_NET (GF_DIM=48, R_NUM=3, Z_DIM=100).
  • text_encoder100.pth β€” the DAMSM bi-LSTM RNN_ENCODER (EMBEDDING_DIM=256).
  • captions.pickle β€” COCO caption metadata; provides ixtoword/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.).

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Space using mediasynthesismuseum/attngan-coco 1