Skip to content
Keras implementation of CycleGAN using a tensorflow backend.
Python
Branch: master
Clone or download
simontomaskarlsson Merge pull request #28 from kpagels/patch-1
label for GA_losses and GB_losses turned around
Latest commit 05c2dab Nov 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ReadMe fix(readme) Aug 1, 2018
generate_images add(first commit, model and readme) Aug 1, 2018
.gitignore
LICENSE Create LICENSE Mar 23, 2019
README.md Update README.md Jul 19, 2019
load_data.py Add(comment about normalization formula for 16 bit depth images) Feb 11, 2019
model.py Fix PatchGAN size according to original CycleGAN Oct 29, 2019
plotCSVfile.py label for GA_losses and GB_losses turned around Nov 19, 2019

README.md

Keras implementation of CycleGAN

Implementation using a tensorflow backend. Testing and evaluation done on street view images.

Results - 256x256 pixel images

Day 2 night

Input Translation Input Translation
drawing drawing drawing drawing
drawing drawing drawing drawing

Night 2 day

Input Translation Input Translation
drawing drawing drawing drawing
drawing drawing drawing drawing

Model additions as training options

  • Identity learning (on different modulus of training iterations)
  • PatchGAN in discriminators
  • Multi-scale discriminators
  • Resize convolution in generators
  • Supervised learning with training weight
  • Data generator (if using a large dataset)
  • Weight on discriminator training labels on real images

Code usage

  1. Prepare your dataset under the directory 'data' and set dataset name to parameter 'image_folder' in CycleGAN init function.
  • Directory structure on new dataset needed for training and testing:
    • data/Dataset-name/trainA
    • data/Dataset-name/trainB
    • data/Dataset-name/testA
    • data/Dataset-name/testB
  1. Set wanted training options, also found in the init function.

  2. Train a model by:

python model.py
  1. Generate synthetic images by following specifications under:
  • generate_images/ReadMe.rtf

The following gif shows an example of the training progression in a translation from day to night.

Left: Input image. Middle: Translated images. Right: Reconstructed images. drawing


More results

Day 2 night - gif

drawing

Rainy 2 sunny - gif

drawing

Sunny 2 rainy - gif

drawing

You can’t perform that action at this time.