gitwtfhub

wtf is cyclegan?

junyanz/cyclegan — explained in plain English

Analysis updated 2026-06-24

12,852LuaAudience · researcherComplexity · 4/5Setup · hard

TL;DR

A research implementation of CycleGAN, an AI technique that converts images from one visual style to another, like photos to Monet paintings or horses to zebras, without needing matched image pairs.

Mindmap

mindmap
  root((CycleGAN))
    What it does
      Image style transfer
      No paired examples
      Bidirectional mapping
    Examples
      Photo to painting
      Horse to zebra
      Maps to satellite
    Tech
      Lua and Torch
      NVIDIA GPU required
      Pre-trained models
    Limitations
      Research codebase
      Older Torch version
      PyTorch version exists

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Convert your landscape photos into the painting style of Monet or Van Gogh using a pre-trained model.

REASON 2

Transform horse photos into zebra photos (and back) to experiment with unpaired image translation.

REASON 3

Train your own CycleGAN model on two custom image collections to transfer visual styles between them.

REASON 4

Convert street map tiles into aerial satellite views using the included pre-trained model.

What's in the stack?

LuaTorchCUDAPython

How it stacks up

junyanz/cycleganneovim/nvim-lspconfigkarpathy/char-rnn
Stars12,85213,63512,065
LanguageLuaLuaLua
Last pushed2023-10-24
MaintenanceDormant
Setup difficultyhardmoderatehard
Complexity4/53/53/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · hard Time to first run · 1h+

Requires an NVIDIA GPU and the Lua-based Torch framework, the authors recommend using the newer PyTorch version in a separate repository for new projects.

Wtf does this do

CycleGAN is a research implementation of an image transformation technique that can convert photos from one visual style to another without needing matched before-and-after examples. Rather than requiring pairs of images (for instance, the same horse photographed and then re-drawn as a zebra), the method learns from two separate collections of images and figures out the mapping between them on its own. The examples in the README show what this can do in practice: converting landscape photos into the painting style of Monet, Van Gogh, or Cezanne, turning photos of horses into photos that look like zebras and back again, converting street map tiles into aerial satellite photos, translating iPhone flower photos into photos that look like they were taken with a professional DSLR camera, and transferring the appearance of summer scenes into winter ones. This particular repository contains the original implementation written in Lua using the Torch framework, published alongside a research paper from the Berkeley AI Research Lab in 2017. The authors note that a newer PyTorch version of the code also exists in a separate repository and is more actively maintained. To use the pre-trained models, you download the model weights and point the test script at your images. Training your own model requires an NVIDIA GPU. The repository provides pre-trained models for the transformation pairs listed above, so you can start running experiments without training from scratch. This is a research codebase rather than a production application. It requires familiarity with machine learning tooling and command-line usage. The README covers installation, dataset downloads, training commands, and testing.

Yoink these prompts

Prompt 1
Using the pre-trained CycleGAN model from junyanz/cyclegan, show me how to convert my own photos into Monet painting style, give me the exact test command.
Prompt 2
Walk me through training a new CycleGAN model on my own two image folders using the Torch framework, from dataset prep to running training.
Prompt 3
How do I download the horse-to-zebra pre-trained CycleGAN model and run batch inference on a folder of images from the command line?
Prompt 4
What are the differences between the original Lua/Torch CycleGAN repo and the newer PyTorch version, and which should I use for a new project?

Frequently asked questions

wtf is cyclegan?

A research implementation of CycleGAN, an AI technique that converts images from one visual style to another, like photos to Monet paintings or horses to zebras, without needing matched image pairs.

What language is cyclegan written in?

Mainly Lua. The stack also includes Lua, Torch, CUDA.

How hard is cyclegan to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is cyclegan for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.