Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

DCGAN

This is the implementation of "Deep Convolutional Generative Adversarial Networks".
Original paper: A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In International Conference on Learning Representations, 2016. link

Usage

1. Build

Please build the source file according to the procedure.

$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ cd ..

2. Dataset Setting

Recommendation

  • Large-scale CelebFaces Attributes (CelebA) Dataset
    This is a large-scale face attributes dataset with more than 200K celebrity images, each with 40 attribute annotations.
    Link: official

Setting

Please create a link for the dataset.
The following hierarchical relationships are recommended.

datasets
|--Dataset1
|    |--train
|    |    |--image1.png
|    |    |--image2.bmp
|    |    |--image3.jpg
|    |
|    |--valid
|
|--Dataset2
|--Dataset3

You should substitute the path of training data for "<training_path>".
The following is an example for "celebA".

$ cd datasets
$ mkdir celebA
$ cd celebA
$ ln -s <training_path> ./train
$ cd ../..

3. Training

Setting

Please set the shell for executable file.

$ vi scripts/train.sh

The following is an example of the training phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.

#!/bin/bash

DATA='celebA'

./DCGAN \
    --train true \
    --epochs 300 \
    --dataset ${DATA} \
    --size 256 \
    --loss "vanilla" \
    --batch_size 16 \
    --gpu_id 0 \
    --nc 3

Run

Please execute the following to start the program.

$ sh scripts/train.sh

4. Image Synthesis

Setting

Please set the shell for executable file.

$ vi scripts/synth.sh

The following is an example of the synthesis phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.

#!/bin/bash

DATA='celebA'

./DCGAN \
    --synth true \
    --dataset ${DATA} \
    --size 256 \
    --gpu_id 0 \
    --nc 3

If you want to generate image, the above settings will work.

Run

Please execute the following to start the program.

$ sh scripts/synth.sh

5. Image Sampling

Setting

Please set the shell for executable file.

$ vi scripts/sample.sh

The following is an example of the sampling phase.
If you want to view specific examples of command line arguments, please view "src/main.cpp" or add "--help" to the argument.

#!/bin/bash

DATA='celebA'

./DCGAN \
    --sample true \
    --dataset ${DATA} \
    --sample_total 100 \
    --size 256 \
    --gpu_id 0 \
    --nc 3

If you want to generate image, the above settings will work.

Run

Please execute the following to start the program.

$ sh scripts/sample.sh