Pytorch implementation on "High-fidelity Synthesis with Disentangled Representation" (https://arxiv.org/abs/2001.04296).
For ID-GAN augmented with Variational Discriminator Bottleneck (VDB) or VGAN, please refer to the vgan branch.
- Create
data
directory, and put the necessary datasets inside here.
mkdir data
- dSprites dataset.
cd data
git clone https://github.com/deepmind/dsprites-dataset.git
cd dsprites-dataset
rm -rf .git* *.md LICENSE *.ipynb *.gif *.hdf5
- CelebA dataset.
- Go to the official website (link) and download
img_align_celeba.zip
file todata
directory.
data
|- preprocess.py
|_ img_align_celeba.zip
- Preprocess the data.
python data/preprocess.py celeba
- CelebA-HQ dataset.
- Go to the google drive (link) and download
data1024x1024.zip
file todata
directory.
data
|- preprocess.py
|_ data1024x1024.zip
- Preprocess the data.
python data/preprocess.py celeba-hq
- 3D Chairs dataset.
- Go to the official website (link) and download
rendered_chairs.tar
file todata
directory.
data
|- preprocess.py
|_ rendered_chairs.tar
- Preprocess the data.
python data/preprocess.py chairs
- 3D Cars dataset.
- Go to the official website (link) and download
cars_train.tgz
,cars_test.tgz
, andcar_devkit.tgz
files todata
directory.
data
|- preprocess.py
|- cars_train.tgz
|- cars_test.tgz
|_ car_devkit.tgz
- Preprocess the data.
python data/preprocess.py cars
- You can run pre-defined commands as follows
bash scripts/run_dsprites.sh
bash scripts/run_celeba.sh
bash scripts/run_chairs.sh
bash scripts/run_cars.sh
- Stage 1: Train VAEs.
python dvae_main.py --dataset [dataset_name] --name [dvae_run_name] --c_dim [c_dim] --beta [beta]
, where [dataset_name]
can be one of dsprites
, celeba
, cars
, and chairs
.
please refer to dvae_main.py
for the details.
- Stage 2: Train ID-GAN through information distillation loss.
python train.py --config [config_name] --dvae_name [dvae_run_name] --name [idgan_run_name]
please refer to configs
directory for [config_name]
.
Results, including checkpoints, tensorboard logs, and images can be found in outputs
directory.
This code is built on the repos as follows:
- Beta-VAE: https://www.github.com/1Konny
- GAN with R2 regularization: https://github.com/LMescheder/GAN_stability
- VGAN: https://github.com/akanazawa/vgan
If you find our work useful for your research, please cite our paper.
@article{lee2020highfidelity,
title={High-Fidelity Synthesis with Disentangled Representation},
author={Wonkwang Lee and Donggyun Kim and Seunghoon Hong and Honglak Lee},
year={2020},
journal={arXiv preprint arXiv:2001.04296},
}