Skip to content
Keras implementation of CycleGAN
Branch: master
Clone or download
Latest commit 7a9bf74 Dec 12, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.
data Update Oct 13, 2017
pics Update Dec 11, 2017 Add files via upload Nov 29, 2017 Add files via upload Nov 28, 2017 Add files via upload Nov 28, 2017 Add files via upload Dec 11, 2017

CycleGAN with perception loss

What is this repository for?

Implementation of CycleGan model in Keras (original implementation link).

Demonstration: De-raining images

The example below presents 18 rainy images of shape (128x128x3) where cycleGAN with perception loss has been used to de-rain.

How do I get set up ?

Install Anaconda 3 Import the conda environment named deepenv using :

conda env create -f deepenv.yml

Activate that environment using :

source activate deepenv

Now all the dependencies must be installed without problems (Keras 2, tensorflow 1 ...)

How do I train CycleGAN ?

you may have information on how to run by:

python --help

you can train your own model by running (N.B.: example):

python --path_trainA ./data/trainA --path_trainB ./data/trainB --pic_dir ./intermediate_res --lmbd 10

How do I train CycleGAN with perception loss ?

you can train CycleGan with Perception loss by running:

python --path_trainA ./data/trainA --path_trainB ./data/trainB --pic_dir ./intermediate_res --lmbd 10 --lmbd_feat 1

How do I deploy CycleGAN on new images after training?

you can deploy the model on a given collection, in order to transform A to B or B to A (Possible only after training).

python --path_images ./data/trainA --pic_dir ./results --model_path ./../a2b.h5


└── cyclegan
    ├── data                         # data folder contaning both A and B images
         ├── trainA                  # images belonging to class A
         └── trainB                  # images belonging to class B
    ├── pics                         # intermediate results folders (for training phase)
    ├── deepenv.yml                  # Environment (keras 2, tensorflow 1.1, etc ...)
    ├──             # discriminator
    ├──                 # generator (Resblock 6 & unet_128)
    ├──            # utils for perception loss (Resnet50)
    ├──                  # cnn for perception loss (Resnet50)
    ├──                    # ReflectPadding2D & InstanceNormalization2D
    ├──                    # cycleGAN: fit & predict
    ├──                    # Readme
    ├──                      # deploy model
    ├──                     # train model
    ├──                     # utils


You can’t perform that action at this time.