Skip to content

simontomaskarlsson/CycleGAN-Keras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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