CycleGAN_Tensorlayer icon indicating copy to clipboard operation
CycleGAN_Tensorlayer copied to clipboard

Re-implement CycleGAN in Tensorlayer

CycleGAN_Tensorlayer

Re-implement CycleGAN in TensorLayer

  • Original CycleGAN
  • Improved CycleGAN with resize-convolution

Prerequisites:

  • TensorLayer
  • TensorFlow
  • Python

Run:

CUDA_VISIBLE_DEVICES=0 python main.py 

(if datasets are collected by yourself, you can use dataset_clean.py or dataset_crop.py to pre-process images)

Theory:

The generator process:

Image text

The discriminator process:

Image text

Result Improvement

  • Data augmentation
  • Resize convolution[4]
  • Instance normalization[5]

data augmentation:

Image text

Instance normalization(comparision by original paper https://arxiv.org/abs/1607.08022):

Image text

Resize convolution (Remove Checkerboard Artifacts):

Image text

Image text

Final Results:

Image text

Image text

Reference:

  • [1] Original Paper: https://arxiv.org/pdf/1703.10593.pdf
  • [2] Original implement in Torch: https://github.com/junyanz/CycleGAN/
  • [3] TensorLayer by HaoDong: https://github.com/zsdonghao/tensorlayer
  • [4] Resize Convolution: https://distill.pub/2016/deconv-checkerboard/
  • [5] Instance Normalization: https://arxiv.org/abs/1607.08022