Pytorch implementation for reproducing COCO results in the paper StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generative Adversarial Networks by Han Zhang, Tao Xu, Hongsheng Li, Shaoting Zhang, Xiaogang Wang, Xiaolei Huang, Dimitris Metaxas. The network structure is slightly different from the tensorflow implementation.
python 2.7
Pytorch
In addition, please add the project folder to PYTHONPATH and pip install
the following packages:
tensorboard
python-dateutil
easydict
pandas
torchfile
Data
data/coco
.
data/coco/
.Training
python main.py --cfg cfg/coco_s1.yml --gpu 0
python main.py --cfg cfg/coco_s2.yml --gpu 1
*.yml
files are example configuration files for training/evaluating our models.Pretrained Model
models/coco
.Evaluating
python main.py --cfg cfg/coco_eval.yml --gpu 2
to generate samples from captions in COCO validation set.Examples for COCO:
Save your favorite pictures generated by our models since the randomness from noise z and conditioning augmentation makes them creative enough to generate objects with different poses and viewpoints from the same discription :smiley:
If you find StackGAN useful in your research, please consider citing:
@inproceedings{han2017stackgan,
Author = {Han Zhang and Tao Xu and Hongsheng Li and Shaoting Zhang and Xiaogang Wang and Xiaolei Huang and Dimitris Metaxas},
Title = {StackGAN: Text to Photo-realistic Image Synthesis with Stacked Generative Adversarial Networks},
Year = {2017},
booktitle = {{ICCV}},
}
Our follow-up work
References