• Stars
    star
    813
  • Rank 53,906 (Top 2 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔥🔥 PyTorch implementation of "Progressive growing of GANs (PGGAN)" 🔥🔥

Pytorch Implementation of "Progressive growing GAN (PGGAN)"

PyTorch implementation of PROGRESSIVE GROWING OF GANS FOR IMPROVED QUALITY, STABILITY, AND VARIATION
YOUR CONTRIBUTION IS INVALUABLE FOR THIS PROJECT :)

image

What's different from official paper?

  • original: trans(G)-->trans(D)-->stab / my code: trans(G)-->stab-->transition(D)-->stab
  • no use of NIN layer. The unnecessary layers (like low-resolution blocks) are automatically flushed out and grow.
  • used torch.utils.weight_norm for to_rgb_layer of generator.
  • No need to implement the the Celeb A data, Just come with your own dataset :)

How to use?

[step 1.] Prepare dataset
The author of progressive GAN released CelebA-HQ dataset, and which Nash is working on over on the branch that i forked this from. For my version just make sure that all images are the children of that folder that you declare in Config.py. Also i warn you that if you use multiple classes, they should be similar as to not end up with attrocities.

---------------------------------------------
The training data folder should look like : 
<train_data_root>
                |--Your Folder
                        |--image 1
                        |--image 2
                        |--image 3 ...
---------------------------------------------

[step 2.] Prepare environment using virtualenv

  • you can easily set PyTorch (v0.3) and TensorFlow environment using virtualenv.
  • CAUTION: if you have trouble installing PyTorch, install it mansually using pip. [PyTorch Install]
  • For install please take your time and install all dependencies of PyTorch and also install tensorflow
$ virtualenv --python=python2.7 venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ conda install pytorch torchvision -c pytorch

[step 3.] Run training

  • edit config.py to change parameters. (don't forget to change path to training images)
  • specify which gpu devices to be used, and change "n_gpu" option in config.py to support Multi-GPU training.
  • run and enjoy!
  (example)
  If using Single-GPU (device_id = 0):
  $ vim config.py   -->   change "n_gpu=1"
  $ CUDA_VISIBLE_DEVICES=0 python trainer.py
  
  If using Multi-GPUs (device id = 1,3,7):
  $ vim config.py   -->   change "n_gpu=3"
  $ CUDA_VISIBLE_DEVICES=1,3,7 python trainer.py

[step 4.] Display on tensorboard (At the moment skip this part)

  • you can check the results on tensorboard.

$ tensorboard --logdir repo/tensorboard --port 8888
$ <host_ip>:8888 at your browser.

[step 5.] Generate fake images using linear interpolation

CUDA_VISIBLE_DEVICES=0 python generate_interpolated.py

Experimental results

The result of higher resolution(larger than 256x256) will be updated soon.

Generated Images







Loss Curve

image

To-Do List (will be implemented soon)

  • Support WGAN-GP loss
  • training resuming functionality.
  • loading CelebA-HQ dataset (for 512x512 and 1024x0124 training)

Compatability

  • cuda v8.0 (if you dont have it dont worry)
  • Tesla P40 (you may need more than 12GB Memory. If not, please adjust the batch_table in dataloader.py)

Acknowledgement

Author

MinchulShin, @nashory

Contributors

DeMarcus Edwards, @Djmcflush
MakeDirtyCode, @MakeDirtyCode
Yuan Zhao, @yuanzhaoYZ
zhanpengpan, @szupzp

More Repositories

1

gans-awesome-applications

Curated list of awesome GAN applications and demo
4,863
star
2

DeLF-pytorch

PyTorch Implementation of "Large-Scale Image Retrieval with Attentive Deep Local Features"
Jupyter Notebook
341
star
3

gans-collection.torch

Torch implementation of various types of GAN (e.g. DCGAN, ALI, Context-encoder, DiscoGAN, CycleGAN, EBGAN, LSGAN)
Lua
55
star
4

progressive-growing-torch

Torch implementation of "PROGRESSIVE GROWING OF GANS FOR IMPROVED QUALITY, STABILITY, AND VARIATION"
Lua
36
star
5

text2image-benchmark

Performance comparison of existing GAN based Text To Image algorithms. (GAN-CLS, StackGAN, TAC-GAN)
Python
28
star
6

rtic-gcn-pytorch

Official PyTorch Implementation of RITC
Python
20
star
7

FashionIQChallenge2020

2nd Place Team's Solution for Fashion IQ Challenge 2020
Python
15
star
8

dense-equi-torch

Torch7 implementation of Unsupervised object learning from dense equivariant image labelling
Lua
11
star
9

pixel-dt-gan-pytorch

Pytorch implementation of pixel level domain transfer
Python
9
star
10

facial-expression-recognition-using-Caffe

This is very basic code for facial expression recognition using Caffe.
Python
7
star
11

pixel-level-dt-torch

Torch implementation of "Pixel-Level Domain Transfer"
Lua
5
star
12

rl-tutorial-by-games

Game collection trained by SOTA reinforcement learning algorithms for tutorial
Python
5
star
13

loader-torch

An Multi-threaded Data Loader Module for Torch.
Lua
5
star
14

image_converter

Multi-threaded image converter for easy image preprocessing for torch.
Lua
4
star
15

BEGAN-torch7

Torch implementation of BEGAN: Boundary Equilibrium Generative Adversarial Networks
Lua
3
star
16

ModelZoo-torch

Model Zoo for torch7 (no need to use loadcaffe module)
2
star
17

simulated-unsupervised-pytorch

PyTorch implementation of "Learning from Simulated and Unsupervised Images through Adversarial Training"
2
star
18

newest-ML-trends

A Introduction and analysis of latest deep learning techniques.
1
star
19

rl-playground

my playground for testing RL-algorithms implemented in pytorch
Python
1
star
20

nashory.github.io

Minchul Shin's github blog powered by Jekyll and Bootstrap
HTML
1
star
21

irbench-python

Image Retrieval Performance Benchmark Tool for Large-scale Dataset
1
star
22

link

1
star
23

caffe-easystart

Caffe training template for easy implementation
Shell
1
star