"Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks"
Paper: https://arxiv.org/pdf/1703.10593.pdf
Image-to-image translation is a class of vision and graphics problems where the goal is to learn the mapping between an input image and an output image using a training set of aligned image pairs. However, for many tasks, paired training data will not be available. We present an approach for learning to translate an image from a source domain X to a target domain Y in the absence of paired examples. Our goal is to learn a mapping G:X→Y such that the distribution of images from G(X) is indistinguishable from the distribution Y using an adversarial loss. Because this mapping is highly under-constrained, we couple it with an inverse mapping F:Y→X and introduce a cycle consistency loss to push F(G(X))≈X (and vice versa). Qualitative results are presented on several tasks where paired training data does not exist, including collection style transfer, object transfiguration, season transfer, photo enhancement, etc. Quantitative comparisons against several prior methods demonstrate the superiority of our approach.
- Modify the ResNet-Generator with recursive residual blocks like in the DRRN. http://cvlab.cse.msu.edu/pdfs/Tai_Yang_Liu_CVPR2017.pdf
- Option to use an U-Net with skip connections.
- An an perceptual loss witch is extracted and calculated from the discriminator network of the corresponding domain A or B.
- Coming soon
- tensorflow >= 1.8
- pil
- numpy
- Clone the repository
$ git clone https://github.com/Shumway82/tf_base.git
- Go to folder
$ cd tf_base
- Install with pip3
$ pip3 install -e .
- Clone the repository
$ git clone https://github.com/Shumway82/CycleGAN.git
- Go to folder
$ cd CycleGAN
- Install with pip3
$ pip3 install -e .
- Training
$ python pipeline_trainer.py --dataset "../horse2zebra/" --config_path "../config/"
- Inferencing
$ python pipeline_inferencer.py --dataset "../horse2zebra/testA" --outdir ../Results/Horse2Zebra_AtoB" --model_dir ../pretrained_models/generator/Horse2Zebra/"