OpenViSTAI · Agents · Blockchain · Crypto
Menu
Image & Video AI

Pytorch Cyclegan And Pix2Pix

Pytorch Cyclegan And Pix2Pix is a Python and PyTorch codebase for paired pix2pix and unpaired CycleGAN image-to-image translation. It includes training and testing scripts, example dataset download scripts, and templates for custom models and datasets.

Independent OpenViST project profile, based on linked sources.

Pytorch Cyclegan And Pix2Pix — OpenViST project profile in Image & Video AI.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use the repository when you want to work directly with PyTorch training and testing code for paired or unpaired image translation, rather than a hosted image-editing interface.

Who it is for

  • Researchers reproducing or adapting image-to-image translation experiments.
  • Developers training image-conversion models with paired or unpaired datasets.

Documented uses

  • Train a pix2pix model on paired image examples.
  • Train a CycleGAN model on unpaired image collections.
  • Test a trained model and inspect generated outputs in an HTML results page.
  • Adapt the code using its custom model and dataset templates.
Before you choose

Requirements & limits

  • The dataset setup determines the model path: pix2pix is the paired workflow, while CycleGAN is the unpaired workflow.
  • The README reports Python 3.11 and PyTorch 2.4+ support; it also identifies an older branch for PyTorch 0.1–0.3.
  • The project includes example dataset-download scripts and Conda environment instructions; Docker guidance is also referenced.
  • Optional W&B dashboard logging is available through the --use_wandb training flag.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Train and test a paired pix2pix model

Follow the repository's facades example to train pix2pix and produce test results.

Before you start

  • Clone the repository.
  • Install PyTorch and the other dependencies; the README also provides a Conda environment file.
  • Use the facades dataset or another suitable paired pix2pix dataset.

Steps

  1. Download the example dataset with the command below.

    Documented command
    bash ./datasets/download_pix2pix_dataset.sh facades
  2. Train with the command below.

    Documented command
    python train.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA
  3. Test with the command below.

    Documented command
    python test.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA

Expected outcome

The README says intermediate training results are viewable under `./checkpoints/facades_pix2pix/web/index.html`; test results are saved as an HTML page under `./results/facades_pix2pix/latest_test/index.html`.

Guide limitations

  • The guide follows the documented facades example; using another dataset requires a suitable paired dataset and corresponding data-root and direction settings.
Source-based practical guide

Train and test an unpaired CycleGAN model

Follow the repository's maps example to train CycleGAN and generate test results.

Before you start

  • Clone the repository.
  • Install PyTorch and the other dependencies; the README also provides a Conda environment file.
  • Use the maps dataset or another suitable unpaired CycleGAN dataset.

Steps

  1. Download the example dataset with the command below.

    Documented command
    bash ./datasets/download_cyclegan_dataset.sh maps
  2. Train with the command below.

    Documented command
    python train.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan
  3. Test with the command below.

    Documented command
    python test.py --dataroot ./datasets/maps --name maps_cyclegan --model cycle_gan

Expected outcome

The README says intermediate training results are viewable under `./checkpoints/maps_cyclegan/web/index.html`; test results are saved under `./results/maps_cyclegan/latest_test/index.html`.

Guide limitations

  • The guide follows the documented maps example; other datasets require suitable unpaired data and corresponding data-root settings.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
17 October 2026
Original website title
junyanz/pytorch-CycleGAN-and-pix2pix · Official homepage title · retained in its source language

Related options

img2img-turbo — The repository points to this separate project for pix2pix-turbo and CycleGAN-Turbo one-step translation methods.

Contrastive Unpaired Translation (CUT) — The repository points to CUT as another unpaired image-translation approach, described there as enabling faster, memory-efficient training.