Study Friendly Implementation of DiscoGAN in Pytorch
More Information: Original Paper
Implemenation based on Official Implementation, but Simplified.
- GAN: [Pytorch][Tensorflow]
- DCGAN: [Pytorch][Tensorflow]
- InfoGAN: [Pytorch][Tensorflow]
- Pix2Pix: [Pytorch][Tensorflow]
- DiscoGAN: [Pytorch][Tensorflow]
- Ubuntu 16.04
- Python 3.6 (Anaconda)
- Pytorch 0.2.0
- Torchvision 0.1.9
- PIL
- cv2 (OpenCV) (pip install python-opencv)
discogan.py
: Main Codediscogan_test.py
: Test Code after Trainingnetwork.py
: Generator and Discriminatordb/download.sh
: DB Downloader (Edges/Shoes/Handbags)db/download.py
: DB Downloader (Facescrub)
- Image Size = 64x64
- Batch Size = 64
- Learning Rate = 0.0002
- Weight Decay = 0.00001
- Adam_beta1 = 0.5
- Loss Weights: See the code
- Scheduling: See the code
./db/download.sh dataset_name
dataset_name can be one of [edges2shoes, edges2handbags]
You can do handbags2shoes using both datasets.
edges2shoes
: 600x500, 1096 for Train, 1098 for Valedges2handbags
: 256x256, 138567 for Train, 200 for Val
python ./db/download.py
This code downloads face image independently. So there are some problems.
After download images 10~20k,
You should remove some broken images MANUALLY. :<
facescrub/actors/face
: Various Sizefacescrub/actresses/face
: Various Size
python discogan.py --task edges2shoes #(or handbags)
python discogan.py --task handbags2shoes --starting_rate 0.5
python discogan.py --task facescrubs
After finish training, saved models are in the ./models
directory.
python discogan_test.py --task taskname --num_epochs N --batctSize M
batchSize
means test sample size.num_epochs
is the parameter which model will be used for test.
Test results will be saved in ./test_result