Giter VIP home page Giter VIP logo

colorization_by_improved-cyclegan's Introduction

Colorization by Improved-CycleGAN

Overview

Image-to-image translation aims at learning a mapping of images between different domains, and many successful tasks relied on aligned image pairs. However, it’s not easy to generate paired data for general tasks. Besides, it’s known that generative adversarial networks (GANs) has excellent performance in image generation and image editing. Therefore, we design a system, built on existed Cycle-GAN model, to translate black-and-white film into colorized one automatically.

Demo

Dataset

  1. Create a dataset folder in "datasets", ex: micky
  2. Put some training data in "trainA" and "trainB", ex: Gray scale in A and RGB in B
  3. Put some testing data in "testA" and "testB", ex: Gray scale in A and RGB in B

[Note]
  (1). CycleGAN can transfer something from domain A to domain B and from domain B to domain A
  (2). In "trainA" and "trainB", I only put some image as example.

Training

  1. Run main.py to training our Improved-CycleGAN
  2. Command line:
CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=micky --phase=train

Testing

  1. Run main.py to testing our Improved-CycleGAN
  2. Command line:
CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=micky --phase=test --which_direction=AtoB
  1. AtoB means transfer image from A to B, ex: from Gray scale to RGB

Result

1. Flow Chart

  • We improved cycleGAN model with "Improved-WGAN", which is based on "WGAN".


2. Some Results

  • Training Set
  • Testing Set

3. Training Visualization

  • Discriminator da_loss means the loss of discriminator on domain A and db_loss means the loss of discriminator on domain B. d_loss is equal to (da_loss + db_loss) meaning discriminator loss.


  • Generator g_loss_a2b means the loss of generator for changing domain A to domain B and g_loss_b2a means the loss of generator for changing domain B to domain A. g_loss is equal to (g_loss_a2b + g_loss_b2a) meant generator loss.


Requirements

  • TensorFlow
  • numpy, scipy, pillow

Reference

colorization_by_improved-cyclegan's People

Contributors

ching-ju-henry avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

deepikagoel1

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.