Study Friendly Implementation of DiscoGAN in Tensorflow
[Paper | Post(in Korean) | Pytorch Version]
- GAN: [Pytorch][Tensorflow]
- DCGAN: [Pytorch][Tensorflow]
- InfoGAN: [Pytorch][Tensorflow]
- Pix2Pix: [Pytorch][Tensorflow]
- DiscoGAN: [Pytorch][Tensorflow]
- Windows 10 / Linux Ubuntu 16.04.3 (both available)
- Python 3.5.4 (Anaconda)
- Tensorflow 1.4.1
- Numpy 1.13.3
train.py
: Main Codetest.py
: Test Code after Trainingmodel.py
: Generator and Discriminatordbread.py
: My Own Code for Reading Database
- Image Size = 64x64 (Resized)
- Batch Size = 64
- Learning Rate = 0.0002
- Adam_beta1 = 0.5
Image ref: taeoh-kim's Github
Image ref: taeoh-kim's Github
We will split the Pix2Pix database and use them.
- facades:
python database/download-dataset.py facades
- cityscapes:
python database/download-dataset.py cityscapes
- maps:
python database/download-dataset.py maps
- edges2shoes:
python database/download-dataset.py edges2shoes
- edges2handbags:
python database/download-dataset.py edges2handbags
download-dataset.py
is from this github link
Or, you can simply download all database from this link
You can cut each paired data into two unpaired data to run discogan with following command.
python database/split_db.py --input paired_database_dir --output output_dir
python train.py
--train_A
: Directory of the first train database (without last '/')--train_B
: Directory of the second train database (without last '/')--out_dir
: Directory to Save your Train Result--epochs
: Num of Epochs You Want--batch_size
: Batch Size You Want
After finish training, saved models are in the ./output_dir/checkpoint
directory and the Train Results are saved in ./output_dir/result
.
python test.py
--test
: Directory of the test database--out_dir
: Directory to save your test result--ckpt_dir
: Directory of Trained Model(ex:./out_dir/checkpoint
)--visnum
: Number of visualization per one image file--direction
: 'AtoB' or 'BtoA'--img_num
: The number of images you want to get in test phase.
Test results will be saved in ./out_dir
.