DCGAN-LSGAN-WGAN-GP-DRAGAN-Pytorch

Pytorch implementations of DCGAN, LSGAN, WGAN-GP(LP) and DRAGAN.

Recommendation

  • Our GAN based work for facial attribute editing - AttGAN.

New

  • 28 June 2019: We re-implement these GANs by Pytorch 1.1! The old version is here: v0 or in the "v0" directory.
  • Tensorflow 2 Version

celeba_dragan

anime_dragan


GANs - Pytorch

Pytorch implementations of DCGAN, LSGAN, WGAN-GP(LP) and DRAGAN.

Exemplar results

Fashion-MNIST

DCGAN LSGAN WGAN-GP DRAGAN
fashion-mnist_gan fashion-mnist_lsgan fashion-mnist_wgan-gp fashion-mnist_dragan

CelebA

DCGAN LSGAN
celeba_gan celeba_lsgan
WGAN-GP DRAGAN
celeba_wgan-gp celeba_dragan
WGAN-LP DRAGAN-LP
celeba_wgan-lp celeba_dragan-lp

Anime

WGAN-GP DRAGAN
anime_wgan-gp anime_dragan

Usage

  • Prerequisites

    • PyTorch 1.1
    • tensorboardX
    • scikit-image, oyaml, tqdm
    • Python 3.6
  • Datasets

  • Examples of training

    • Fashion-MNIST DCGAN

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=fashion_mnist --epoch=25 --adversarial_loss_mode=gan
      
    • CelebA DRAGAN

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=celeba --epoch=25 --adversarial_loss_mode=gan --gradient_penalty_mode=dragan
      
    • Anime WGAN-GP

      CUDA_VISIBLE_DEVICES=0 python train.py --dataset=anime --epoch=200 --adversarial_loss_mode=wgan --gradient_penalty_mode=wgan-gp --n_d=5
      
    • see more training exampls in commands.sh

    • tensorboard for loss visualization

      tensorboard --logdir ./output/fashion_mnist_gan/summaries --port 6006
      

GitHub