stackGAN通过文字描述生成图片的V2项目

2018 年 1 月 1 日 CreateAMind

  https://github.com/hanzhanggit/StackGAN-v2



StackGAN-v2

  • StackGAN-v1: Tensorflow implementation

  • StackGAN-v1: Pytorch implementation

  • Inception score evaluation

Pytorch implementation for reproducing StackGAN_v2 results in the paper StackGAN++: Realistic Image Synthesis with Stacked Generative Adversarial Networks by Han Zhang*, Tao Xu*, Hongsheng Li, Shaoting Zhang, Xiaogang Wang,   Xiaolei Huang, Dimitris Metaxas.


Dependencies

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

  1. Download our preprocessed char-CNN-RNN text embeddings for birds and save them to data/

  • [Optional] Follow the instructions reedscot/icml2016 to download the pretrained char-CNN-RNN text encoders and extract text embeddings.

  1. Download the birds image data. Extract them to data/birds/

  2. Download ImageNet dataset and extract the images to data/imagenet/

  3. Download LSUN dataset and save the images to data/lsun

Training

  • Train a StackGAN-v2 model on the bird (CUB) dataset using our preprocessed embeddings:

    • python main.py --cfg cfg/birds_3stages.yml --gpu 0

  • Train a StackGAN-v2 model on the ImageNet dog subset:

    • python main.py --cfg cfg/dog_3stages_color.yml --gpu 0

  • Train a StackGAN-v2 model on the ImageNet cat subset:

    • python main.py --cfg cfg/cat_3stages_color.yml --gpu 0

  • Train a StackGAN-v2 model on the lsun bedroom subset:

    • python main.py --cfg cfg/bedroom_3stages_color.yml --gpu 0

  • Train a StackGAN-v2 model on the lsun church subset:

    • python main.py --cfg cfg/church_3stages_color.yml --gpu 0

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

  • If you want to try your own datasets, here are some good tips about how to train GAN. Also, we encourage to try different hyper-parameters and architectures, especially for more complex datasets.

Pretrained Model

  • StackGAN-v2 for bird. Download and save it to models/ (The inception score for this Model is 4.04±0.05)

  • StackGAN-v2 for dog. Download and save it to models/ (The inception score for this Model is 9.55±0.11)

  • StackGAN-v2 for cat. Download and save it to models/

  • StackGAN-v2 for bedroom. Download and save it to models/

  • StackGAN-v2 for church. Download and save it to models/

Evaluating

  • Run python main.py --cfg cfg/eval_birds.yml --gpu 1 to generate samples from captions in birds validation set.

  • Change the eval_*.yml files to generate images from other pre-trained models.

Examples generated by StackGAN-v2

Tsne visualization of randomly generated birds, dogs, cats, churchs and bedrooms

Citing StackGAN++

If you find StackGAN useful in your research, please consider citing:

@article{Han17stackgan2,
  author    = {Han Zhang and Tao Xu and Hongsheng Li and Shaoting Zhang and Xiaogang Wang and Xiaolei Huang and Dimitris Metaxas},
  title     = {StackGAN++: Realistic Image Synthesis with Stacked Generative Adversarial Networks},
  journal   = {arXiv: 1710.10916},
  year      = {2017},
}
@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

  • AttnGAN: Fine-Grained Text to Image Generation with Attentional Generative Adversarial Networks [Supplementary]

References

  • Generative Adversarial Text-to-Image Synthesis Paper Code

  • Learning Deep Representations of Fine-grained Visual Descriptions Paper Code




招聘请公众号回复招聘

登录查看更多
3

相关内容

ACM/IEEE第23届模型驱动工程语言和系统国际会议,是模型驱动软件和系统工程的首要会议系列,由ACM-SIGSOFT和IEEE-TCSE支持组织。自1998年以来,模型涵盖了建模的各个方面,从语言和方法到工具和应用程序。模特的参加者来自不同的背景,包括研究人员、学者、工程师和工业专业人士。MODELS 2019是一个论坛,参与者可以围绕建模和模型驱动的软件和系统交流前沿研究成果和创新实践经验。今年的版本将为建模社区提供进一步推进建模基础的机会,并在网络物理系统、嵌入式系统、社会技术系统、云计算、大数据、机器学习、安全、开源等新兴领域提出建模的创新应用以及可持续性。 官网链接:http://www.modelsconference.org/
最新《生成式对抗网络》简介,25页ppt
专知会员服务
168+阅读 · 2020年6月28日
专知会员服务
109+阅读 · 2020年3月12日
《强化学习—使用 Open AI、TensorFlow和Keras实现》174页pdf
专知会员服务
136+阅读 · 2020年3月1日
【GitHub实战】Pytorch实现的小样本逼真的视频到视频转换
专知会员服务
35+阅读 · 2019年12月15日
生成式对抗网络GAN异常检测
专知会员服务
114+阅读 · 2019年10月13日
计算机视觉最佳实践、代码示例和相关文档
专知会员服务
17+阅读 · 2019年10月9日
Github 项目推荐 | PyTorch 实现的 GAN 文本生成框架
AI研习社
34+阅读 · 2019年6月10日
项目 | 基于GAN的人脸照片涂鸦编辑
机器学习算法与Python学习
5+阅读 · 2019年3月1日
如何使用注意力模型生成图像描述?
AI研习社
9+阅读 · 2018年8月6日
【干货】基于Keras的注意力机制实战
专知
58+阅读 · 2018年5月4日
文字描述生成视频的开源项目
CreateAMind
5+阅读 · 2017年12月31日
基于对偶学习的跨领域图片描述生成
PaperWeekly
6+阅读 · 2017年11月7日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Seeing What a GAN Cannot Generate
Arxiv
7+阅读 · 2019年10月24日
Arxiv
4+阅读 · 2018年5月21日
Arxiv
10+阅读 · 2018年3月23日
Arxiv
3+阅读 · 2018年3月21日
VIP会员
相关VIP内容
相关资讯
Github 项目推荐 | PyTorch 实现的 GAN 文本生成框架
AI研习社
34+阅读 · 2019年6月10日
项目 | 基于GAN的人脸照片涂鸦编辑
机器学习算法与Python学习
5+阅读 · 2019年3月1日
如何使用注意力模型生成图像描述?
AI研习社
9+阅读 · 2018年8月6日
【干货】基于Keras的注意力机制实战
专知
58+阅读 · 2018年5月4日
文字描述生成视频的开源项目
CreateAMind
5+阅读 · 2017年12月31日
基于对偶学习的跨领域图片描述生成
PaperWeekly
6+阅读 · 2017年11月7日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Top
微信扫码咨询专知VIP会员