FineGAN: Unsupervised Hierarchical Disentanglement for Fine-grained Object Generation and Discovery
Pytorch implementation for learning to synthesize images in a hierarchical, stagewise manner by disentangling background, object shape and object appearance.
Krishna Kumar Singh*, Utkarsh Ojha*, Yong Jae Lee
project |
arxiv | demo video | talk video
CVPR 2019 (Oral Presentation)
git clone https://github.com/kkanshul/finegan
cd finegan
Note: You only need to download the data if you wish to train your own model.
Download the formatted CUB data from this link and extract it inside the data
directory
cd data
unzip birds.zip
cd ..
Pretrained generator models for CUB, Stanford Dogs are available at this link. Download and extract them in the models
directory.
cd models
unzip netG.zip
cd ../code/
In cfg/eval.yml
:
TRAIN.NET_G
.SAVE_DIR
.SUPER_CATEGORIES
and FINE_GRAINED_CATEGORIES
according to our paper.TIED_CODES
:
True
, specify the child code in TEST_CHILD_CLASS
. The background and parent codes are derived through the child code in this case.False
, i.e. no relationship between parent, child or background code, specify each of them in TEST_PARENT_CLASS
, TEST_CHILD_CLASS
and TEST_BACKGROUND_CLASS
respectively.python main.py --cfg cfg/eval.yml --gpu 0
In cfg/train.yml
:
DATA_DIR
.
SUPER_CATEGORIES
and FINE_GRAINED_CATEGORIES
.TRAIN
.python main.py --cfg cfg/train.yml --gpu 0
If you find this code useful in your research, consider citing our work:
@inproceedings{singh-cvpr2019,
title = {FineGAN: Unsupervised Hierarchical Disentanglement for Fine-Grained Object Generation and Discovery},
author = {Krishna Kumar Singh and Utkarsh Ojha and Yong Jae Lee},
booktitle = {CVPR},
year = {2019}
}
We thank the authors of StackGAN++: Realistic Image Synthesis with Stacked Generative Adversarial Networks for releasing their source code.
For any questions regarding our paper or code, contact Krishna Kumar Singh and Utkarsh Ojha.