Giter Club home page Giter Club logo

cyclegan's Introduction

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 train.py by:

python predict.py --help

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

python train.py --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 train.py --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 test.py --path_images ./data/trainA --pic_dir ./results --model_path ./../a2b.h5

Contents

└── 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.py             # discriminator
    ├── generator.py                 # generator (Resblock 6 & unet_128)
    ├── resnet_builder.py            # utils for perception loss (Resnet50)
    ├── resnet50.py                  # cnn for perception loss (Resnet50)
    ├── layers.py                    # ReflectPadding2D & InstanceNormalization2D
    ├── models.py                    # cycleGAN: fit & predict
    ├── README.md                    # Readme
    ├── test.py                      # deploy model
    ├── train.py                     # train model
    ├── utils.py                     # utils

Acknowledgement

cyclegan's People

Contributors

hagopb avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.