GithubHelp home page GithubHelp logo

abylouw / idgan Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1konny/idgan

0.0 0.0 0.0 43 KB

Official PyTorch implementation on ID-GAN: High-Fidelity Synthesis with Disentangled Representation by Lee et al., 2020.

Shell 1.01% Python 98.99%

idgan's Introduction

ID-GAN

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.

Usage

Prepare datasets

  • 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.
  1. Go to the official website (link) and download img_align_celeba.zip file to data directory.
data
|- preprocess.py
|_ img_align_celeba.zip
  1. Preprocess the data.
python data/preprocess.py celeba
  • CelebA-HQ dataset.
  1. Go to the google drive (link) and download data1024x1024.zip file to data directory.
data
|- preprocess.py
|_ data1024x1024.zip
  1. Preprocess the data.
python data/preprocess.py celeba-hq
  • 3D Chairs dataset.
  1. Go to the official website (link) and download rendered_chairs.tar file to data directory.
data
|- preprocess.py
|_ rendered_chairs.tar
  1. Preprocess the data.
python data/preprocess.py chairs 
  • 3D Cars dataset.
  1. Go to the official website (link) and download cars_train.tgz, cars_test.tgz, and car_devkit.tgz files to data directory.
data
|- preprocess.py
|- cars_train.tgz 
|- cars_test.tgz 
|_ car_devkit.tgz 
  1. Preprocess the data.
python data/preprocess.py cars 

Train

  • 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

Results, including checkpoints, tensorboard logs, and images can be found in outputs directory.

Acknowledgement

This code is built on the repos as follows:

  1. Beta-VAE: https://www.github.com/1Konny
  2. GAN with R2 regularization: https://github.com/LMescheder/GAN_stability
  3. VGAN: https://github.com/akanazawa/vgan

Citation

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

idgan's People

Contributors

1konny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.