DRIT-Tensorflow
Simple Tensorflow implementation of Diverse Image-to-Image Translation via Disentangled Representations (ECCV 2018 Oral)
Pytorch version
Requirements
- Tensorflow 1.8
- python 3.6
Usage
Download Dataset
βββ dataset
Β Β βββ YOUR_DATASET_NAME
Β Β βββ trainA
Β Β Β Β Β βββ xxx.jpg (name, format doesn't matter)
βββ yyy.png
βββ ...
Β Β βββ trainB
βββ zzz.jpg
βββ www.png
βββ ...
Β Β βββ testA
Β Β βββ aaa.jpg
βββ bbb.png
βββ ...
Β Β βββ testB
βββ ccc.jpg
βββ ddd.png
βββ ...
βββ guide.jpg (example for guided image translation task)
Train
python main.py --phase train --dataset summer2winter --concat True
Test
python main.py --phase test --dataset summer2winter --concat True --num_attribute 3
Guide
python main.py --phase guide --dataset summer2winter --concat True --direction a2b --guide_img ./guide.jpg
Tips
-
--concat
True
: for the shape preserving translation (summer <-> winter) (default)False
: for the shape variation translation (cat <-> dog)
-
--n_scale
- Recommend
n_scale = 3
(default) - Using the
n_scale > 1
, a.k.a.multiscale discriminator
often gets better results
- Recommend
-
--n_dis
- If you use the multi-discriminator, then recommend
n_dis = 4
(default) - If you don't the use multi-discriminator, then recommend
n_dis = 6
- If you use the multi-discriminator, then recommend
-
--n_d_con
- Author use
n_d_con = 3
(default) - Model can still generate diverse results with
n_d_con = 1
- Author use
-
--num_attribute (only for the test phase)
- If you use the
num_attribute > 1
, then output images are variously generated
- If you use the
Summary
Comparison
Architecture
Train phase
Test & Guide phase
Results
Related works
Author
Junho Kim