Home

Awesome

<!-- <img src='imgs/horse2zebra.gif' align="right" width=384> <br><br><br> -->

CycleGAN

Tensorflow implementation for learning an image-to-image translation without input-output pairs. The method is proposed by Jun-Yan Zhu in Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networkssee. For example in paper:

<img src="imgs/teaser.jpg" width="1000px"/> <!-- ## Applications ### Monet Paintings to Photos <img src="imgs/painting2photo.jpg" width="1000px"/> ### Collection Style Transfer <img src="imgs/photo2painting.jpg" width="1000px"/> ### Object Transfiguration <img src="imgs/objects.jpg" width="1000px"/> ### Season Transfer <img src="imgs/season.jpg" width="1000px"/> ### Photo Enhancement: iPhone photo to DSLR photo <img src="imgs/photo_enhancement.jpg" width="1000px"/> -->

Update Results

The results of this implementation:

You can download the pretrained model from this url and extract the rar file to ./checkpoint/.

Prerequisites

Getting Started

Installation

git clone https://github.com/xhujoy/CycleGAN-tensorflow
cd CycleGAN-tensorflow

Train

bash ./download_dataset.sh horse2zebra
CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=horse2zebra
tensorboard --logdir=./logs

Test

CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=horse2zebra --phase=test --which_direction=AtoB

Training and Test Details

To train a model,

CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=/path/to/data/ 

Models are saved to ./checkpoints/ (can be changed by passing --checkpoint_dir=your_dir).

To test the model,

CUDA_VISIBLE_DEVICES=0 python main.py --dataset_dir=/path/to/data/ --phase=test --which_direction=AtoB/BtoA

Datasets

Download the datasets using the following script:

bash ./download_dataset.sh dataset_name

Reference