Fully working keras implementation of cycleGAN in Python, realized during internship at University of Parma's IMPLab .
[ CycleGAN Authors' repository - CycleGAN paper ]
To download toy example datasets (check available datasets here) use the datasets script:
sh datasets.sh dataset_name
To enable faster image loading into the network you can use hdf5 format by setting use_hdf5=True
in train
function in cycleGAN.py
.
To build .hdf5
datsets use the make_dataset
script in datasets folder:
python3 make_dataset.py dataset_path number_of_channels
For those with limited GPU resources, I suggest downscaling the images through the --img_size
argument (square images are input and output of the network).
To train the network: python3 cycleGAN.py
At the end of each epoch a sample image of predictions on test images is output into ./images
folder, along with the losses plots.
- Python 3
- Tensorflow 1.2 or greater
- Keras 2.1.2
- keras-contrib
- h5py
- glob
- tqdm