Skip to content

Text-to-image generation is a machine learning task that involves generating a visual image based on a given textual description. This uses approach for solving this task is through the use of a StackGAN model. StackGAN is a deep learning architecture that was developed specifically for text-to-image generation tasks.

License

Notifications You must be signed in to change notification settings

pandirabhishek/TextToImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StackGAN++

stackgan++

Realistic Image Synthesis with Stacked Generative Adversarial Networks

This is my PyTorch implementation of StackGAN++ as it is delineated in the paper and the official repo. I attempted to implement it in a configurable way so as to allow for easy experimentation, e.g. I easily set it up afterwards to include a contrastive loss or for Zero-shot Learning. Check out the paper (where I got the above image from) and show some love to the authors at their official repo.

Datasets

Download datasets from links in the official repo. The dataset classes expect your dataset directory to be something like:

CUB
 |
 |- images
 |     |
 |     |- 001.Black_footed_Albatross
 |     |            |
 |     |            |- Black_footed_Albatross_#.jpg
 |     |            |- ...
 |     |- ...
 |
 |- embeddings
 |      |
 |      |- char-CNN-RNN-embeddings.pickle
 |      |- class_info.pickle
 |      |- filenames.pickle
 |
 |- ...other necessary CUB stuff...

StackGAN++ code

The StackGAN class can be found in stackgan/modules/stackgan_v2.py, its training routine in stackgan/training/stackgan_v2.py and all other necessary components can be traced via the imports in these files. To train a StackGAN++, you can use the script scripts/train_stackgan_v2, after configuring the parameters in it to your liking and configuration. Logs and PyTorch models are created automatically. All you need to use the trained model afterwards is to create a StackGAN class instance and load the corresponding .pt file. Happy hacking!

Refrences

Generative Adversarial Text-to-Image Synthesis https://arxiv.org/abs/1605.05396

@article{Bodnar2018TextTI, title={Text to Image Synthesis Using Generative Adversarial Networks}, author={Cristian Bodnar}, journal={CoRR}, year={2018}, volume={abs/1805.00676} }

About

Text-to-image generation is a machine learning task that involves generating a visual image based on a given textual description. This uses approach for solving this task is through the use of a StackGAN model. StackGAN is a deep learning architecture that was developed specifically for text-to-image generation tasks.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published