sahilkhose / StackGAN-BERT

PyTorch implementation of StackGAN paper using BERT embeddings
MIT License
12 stars 4 forks source link

StackGAN

:bulb: What's new?

Pretrained model

Paper examples

:bird: Examples for birds (char-CNN-RNN embeddings), more on youtube:






:sunflower: Examples for flowers (char-CNN-RNN embeddings), more on youtube:






:clipboard: Dependencies

git clone https://github.com/sahilkhose/StackGAN-BERT.git
pip3 install -r requirements.txt

Dataset

Check instructions in /input/README.md

cd input/src
python3 data.py

Generating BERT embeddings of annotations

Change the DEVICE to cpu in input/src/config.py if cuda is not available

python3 bert_emb.py  

:wrench: Training

cd ../../src

Option 1: CLI args training src/args.py

python3 train.py --TRAIN_MAX_EPOCH 10 

Option 2: yaml args training cfg/s1.yml and cfg/s2.yml

python3 train.py --conf ../cfg/s1.yml

mkdir ../old_outputs
mv ../output ../old_outputs/output_stage-1

python3 train.py --conf ../cfg/s2.yml

mv ../output ../old_outputs/output_stage-2

To load the tensorboard

tensorboard --logdir=../output 

:books: Citing StackGAN

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}},
}

Follow-up work

References