Giter VIP home page Giter VIP logo

cyclegan's Introduction

CycleGAN

Cycle GAN implementation in tensorflow 2.0

Requirnments

  1. Tensorflow 2.0
  2. Matplotlib

Dataset

Dataset for training of CycleGAN can be downloaded with following code. This dataset contain images of Horses and Zebras. Our goal is to generate zebras from horses from image to image translation with unpaired training.

_URL = 'https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/horse2zebra.zip'

path_to_zip = tf.keras.utils.get_file('horse2zebra.zip',
                                      origin=_URL,
                                      extract=True)

PATH = os.path.join(os.path.dirname(path_to_zip), 'dataset/')

Sample Image

alt text

Dataset Structure

  ├── dataset                   # Dataset folder
    ├── trainA                  # folder contains Horses
    │   ├── *.jpg         
    |   |........
    |   └── *.jpg        
    ├── trainB                  # folder contains Zebras
    │   ├── *.jpg          
    |   |........
    |   └── *.jpg
    ├── testA                   # test folder contains Horses
    │   ├── *.jpg          
    |   |........
    |   └── *.jpg
    └── testB                   # test folder contains Zebras
        ├── *.jpg          
        |........
        └── *.jpg
     

Train the Model

Windows

python cyclegan.py

Linux and MAC

CUDA_VISIBLE_DEVICES='GPU_NO' python cyclegan.py

Test

In code change mode in **kwargs

kwargs = {'epochs': 500, 
	  'path': 'dataset',
	  'mode':'test', 
	  'output_path':'Exp_1',
          'batch_size':1,
}

Run same command for testing

python cyclegan.py

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.