This readme documentation provides an overview of the code repository that implements the CycleGAN model for image translation. The CycleGAN is a deep learning architecture capable of learning to translate images from one domain to another without the need for paired training data. This document describes the purpose, functionality, and usage of the code.
- Introduction
- Installation
- Getting Started
- Code Structure
- Usage
- Examples
- Conclusion
- References
The CycleGAN Image Translation repository contains code for training and utilizing a CycleGAN model for image translation tasks. The CycleGAN architecture consists of two generators and two discriminators that work together to learn the mapping between two different image domains. It has been widely used for various image-to-image translation tasks, such as converting Monet-style paintings to realistic photographs.
The code in this repository is implemented in Python, utilizing the TensorFlow and Keras libraries for deep learning operations. It provides a flexible framework for training and using CycleGAN models on custom datasets.
To use the code in this repository, follow these steps
- clone the repository
gh repo clone MuthuPalaniappan925/TransCycleNet
- Navigate to the repository directory
cd TransCycleNet
- Install the required dependencies
pip install -r requirements.txt
- Ensure you have Python 3.7 or above installed.
Before using the TransCycleNet model for image translation, some initial setup is required.
-
Dataset Preparation: Prepare your own dataset or use the provided Monet-to-Photo dataset (used in the following code). Ensure that the dataset follows the required directory structure and image format.
-
Training Configuration: Adjust the training configuration parameters in
monopfo.py
to match your dataset and training preferences. You can specify the dataset paths, model hyperparameters, and training options. -
GPU Acceleration (Optional): If you have a compatible GPU, make sure to install the necessary drivers and CUDA toolkit to leverage GPU acceleration during training NOTE: Not used in the given code.
script | Description |
---|---|
monopho.py |
The main script for dataset loading, model training, and image translation using the CycleGAN. |
instancenormalization.py |
Module implementing the Instance Normalization layer used in the generator and discriminator models. - Used in the base research paper |
cycleGAN.py |
Script for defining the discriminator and generator model architecture |
The main functionality of the CycleGAN model is accessible through the monopfo.py
script. Here are the main commands
- Training the CycleGAN model
python monopfo.py --mode Training
- Translating the CycleGAN model
python monopfo.py --model translate
Additional options and parameters are available for customization, such as specifying the dataset path, the number of training epochs, and the batch size.
The CycleGAN Image Translation repository provides a comprehensive implementation of the CycleGAN model for image translation tasks. It allows users to train their own models on custom datasets or use pre-trained models for image translation. The code is modular and flexible, making it easy to adapt for different image domains and applications.
- CycleGAN: Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Networks. Jun-Yan Zhu et al. (2017). https://arxiv.org/abs/1703.10593
- TensorFlow: https://www.tensorflow.org/
- Keras: https://keras.io/
- Keras contribution team: https://github.com/keras-team/keras-contrib