Skip to content

Latest commit

 

History

History
51 lines (34 loc) · 1.87 KB

README.md

File metadata and controls

51 lines (34 loc) · 1.87 KB

First things first
This repo is a convenient clone of AttnGAN by MSFT Research. You can find the original repo at here.

AttnGAN original repo contains the training and testing code. But this repo is solely intended to use for generating images from text using MSCOCO pretrained weights.

AttnGAN

Pytorch implementation for reproducing AttnGAN results in the paper AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks by Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, Xiaodong He. (This work was performed when Tao was an intern with Microsoft Research).

Python version

python 2.7

Dependencies

  • pytorch
  • python-dateutil
  • easydict
  • pandas
  • torchfile
  • nltk
  • scikit-image

YML files

  • *.yml files are example configuration files for training/evaluation our models.

Pretrained Model

Setup script

Run the following script for setting up the dependencies.

./setup.sh

Sampling

  • Run the command from project folder.
python2 gen_art.py --gpu 0 --input_text "Mary had a little lamb" --data_dir data/coco --model_path models/coco_AttnGAN2.pth --textencoder_path DAMSMencoders/coco/text_encoder100.pth --output_dir output` 
  • Output will be stored into output_dir folder.
  • Change the eval_*.yml files to generate images from other pre-trained models. Default config file is cfg/eval_coco.yml.