This is a PyTorch implementation of the Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks.
You can find CycleGAN datasets from this, and chose what kind of dataset you want to download.
To train a model on your own datasets, you need to create a data folder as the following (apple2orange is dataset name).
apple2orange/
train/
X/...jpg
Y/...jpg
test/
X/...jpg
Y/...jpg
python cyclegan.py ARGS
Possible ARGS are:
--img_size
size of image, default is128
;--batch_size
size of minibatch, default is8
;--dataset_name
name of the dataset, default is'apple2orange'
;--n_residual_blocks
number of residual blocks in the generator, default is6
;--max_epoch
numbers of epoch to train, default is200
;--lr
the learning rate of Adam, default is0.0002
;--decay_start_epoch
start of epoch to decay lr, default is100
;--sample_interval
interval between saving generator outputs, default is100
;--checkpoint_interval
interval between saving models, default is100
;--save_images
directory of saving generator outputs, default is'images'
;--save_models
directory of saving models, default is'save_models'
.
An example:
python cyclegan.py --dataset_name "apple2orange"