Skip to content

Re-Implementation of CycleGAN for image-to-image translation

Notifications You must be signed in to change notification settings

PayamDiba/CycleGAN

Repository files navigation

CycleGAN

Re-implementation of the CycleGAN model proposed by Zhu et al. (See it here). CycleGAN is a deep learning model for image-to-image translation in the absence of paired training data. In particular, CycleGAN learns mappings between two domains even if no supervision is available on these mappings. To this end, CycleGAN simultaneously trains and maintains four deep neural networks. Also, a new version of CycleGAN (in /CycleGAN-Sync folder) was developed that can train the model using synchronous distributed training on multiple GPUs.

Applications

I used this model for object transfiguration (horse <-> zebra), artistic style transfer (Monet & Cezzane painting <-> real photo), and season transfer (summer <-> winter). Here are some of the results (data was obtained from here):

Horse <-> Zebra

Painitng <-> Photo

Summer <-> Winter

Train CycleGAN

Run the following command to see a full description of the input flags:

python train.py --help

Example: To train a CycleGAN model on horse-to-zebra data set for 200 epochs, without the identity loss, and without multiprocessing in data loading, run the following:

python train.py --l_idnt 0 --ds horse2zebra --nEpoch 200 --nw 0 > out.log

Running the above command creates the following three folders: 1- data: contains the specified data set 2- models: contains the saved models during training 3- generated_images: contains the evaluation of model during training on 10 randomly sampled data

In order to continue training from a saved model (e.g. the model saved after epoch 49), run the following command:

python train.py --l_idnt 0 --ds horse2zebra --nEpoch 200 --nw 0 --resume True --last_epoch 49 > out.log

Training will be continued while last_epoch < nEpoch.

About

Re-Implementation of CycleGAN for image-to-image translation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages