Practical overview
When it fits
Use it for a Python command-line workflow when you can prepare images from two domains and want to train a CycleGAN translator or generate outputs from test images.
Who it is for
- Developers and researchers building image-to-image translation experiments.
- Users with images organized into two domains who want to train and test a CycleGAN model.
Documented uses
- Train a model to translate between image domains, such as horses and zebras or Monet paintings and photographs.
- Save trained generator and discriminator weights.
- Run generators on test images and save translated results.
- View training loss plots and live output images using Visdom.
Requirements & limits
The repository is public and identifies its license as GPL-3.0.
- The README targets Python 3.6.x and says previous versions have not been tested.
- PyTorch and torchvision are required; Visdom is used for the documented browser-based visualization.
- The documented training and testing examples include a --cuda option, while the README specifically advises removing it for training without a GPU.
- Training and testing are command-line script workflows with outputs saved to directories.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Train a CycleGAN model on a prepared dataset
Train generators and discriminators using images from two domains.
Before you start
- Python 3.6.x is the stated target.
- PyTorch and torchvision.
- A dataset arranged with training images in domain A and domain B folders.
- A GPU for the documented CUDA command; the README says to omit --cuda if training without one.
Steps
Obtain a listed dataset with ./download_dataset , or arrange a custom dataset under datasets//train/A and train/B.
Run ./train --dataroot datasets// --cuda; omit --cuda if training without a GPU.
Optionally run python3 -m visdom in another terminal to view loss graphs and live output images at http://localhost:8097/.
Expected outcome
Training uses the images in the training directory and saves generator and discriminator weights under the output directory.
Guide limitations
- The README says the code is intended for Python 3.6.x and has not been tested with previous versions.
- Visdom is an additional prerequisite for the described browser-based training visualization.
Generate translations from test images
Run trained generators on images in a dataset's test directory and save the translated results.
Before you start
- A dataset with test/A and test/B image folders.
- PyTorch and torchvision.
- Trained generator weights available to the test script.
Steps
Place test images in datasets//test/A and test/B.
Run ./test --dataroot datasets// --cuda; consult ./test --help for options such as which weights to load.
Expected outcome
The script processes test images with the generators and saves outputs under output/A and output/B.
Guide limitations
- The README says testing parameters, including the weights to load, can be changed; it does not provide a complete custom-weight command in the documented instructions.
- The README's Python target is 3.6.x and says previous versions have not been tested.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 October 2026
- Original website title
- aitorzip/PyTorch-CycleGAN · Official homepage title · retained in its source language

