Giter Club home page Giter Club logo

img2imggan's Introduction

img2ImgGAN

Implementation of the paper : Toward Multimodal Image-to-Image Translation

Results

Result First column represents input, second column the ground truth. The next is the image generated from cLR-GAN and the last column represents the image generated from cVAE-GAN. Results were obtained from validation dataset.

Contents:

Model Architecture Visualization

  • Network

Fig 1: Structure of BicycleGAN. (Image taken from the paper)

  • Tensorboard visualization of the entire network

cVAE-GAN Network

Dependencies

  • tensorflow (1.4.0)
  • numpy (1.13.3)
  • scikit-image (0.13.1)
  • scipy (1.0.0)

To install the above dependencies, run:

$ sudo pip install -r requirements.txt

Structure

 -img2imgGAN/
            -nnet
            -utils
            -data/
                  -edges2handbags
                  -edges2shoes
                  -facades
                  -maps

Setup

  • Download the datasets from the following links

  • To generate numpy files for the datasets,

    $ python main.py --create <dataset_name>

    This creates train.npy and val.npy in the corresponding dataset directory. This generates very huge files. As an alternate, the next step attempts to read images at run-time during training

  • Alternate to the above step, you could read the images in real time during training. To do this, you should create files containing paths to the images. This can be done by running the following script in the root of this repo.

    $ bash setup_dataset.sh

Usage

  • Generating graph:

    To visualize the connections between the graph nodes, we can generate the graph using the flag archi. This would be useful to assert the connections are correct. This generates the graph for bicycleGAN

    $ python main.py --archi

    To generate the model graph for cvae-gan,

    $ python main.py --model cvae-gan --archi

    Possible models are: cvae-gan, clr-gan, bicycle (default)

    To visualize the graph on tensorboard, run the following command:

    $ tensorboard --logdir=logs/summary/Run_1 --host=127.0.0.1

    Replace Run_1 with the latest directory name

  • Complete list of options:

    $ python main.py --help

  • Training the network

    To train model (say cvae-gan) on dataset (say facades) from scratch,

    $ python main.py --train --model cvae-gan --dataset facades

    The above command by default trains the model in which images from distribution of domain B are generated conditioned on the images from the distribution of domain A. To switch the direction,

    $ python main.py --train --model cvae-gan --dataset facades --direction b2a

    To resume the training from a checkpoint,

    $ python main.py --resume <path_to_checkpoint> --model cvae-gan

  • Testing the network

    • Download the checkpoint file from here and place the checkpoint files in the ckpt directory

    To test the model from the given trained models, by default the model generates 5 different images (by sampling 5 different noise samples)

    $ ./test.sh <dataset_name> <test_image_path>

    To generate multiple output samples,

    $ ./test.sh <dataset_name> <test_image_path> < # of samples>

    Try it with some of the test samples present in the directory imgs/test

Visualizations

Loss of discriminator and generator as function of iterations on edges2shoes dataset.

TODO

  • Residual Encoder
  • Multiple discriminators for cVAE-GAN and cLR-GAN
  • Inducing noise to all the layers of the generator
  • Train the model on rest of the datasets

License

Released under the MIT license

img2imggan's People

Contributors

kvmanohar22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

img2imggan's Issues

Checkpoint link

Hello, I just relaised that the checkpoint link is not available any more.
I am working on a research and I would love to be able to use your work.
Would it be possible to upload the checkpoint again?

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.