← all repositories
xiaowei-hu/CycleGAN-tensorflow

Turn horses into zebras without paired training data

A straightforward TensorFlow reimplementation of CycleGAN that learns image-to-image translation from unpaired examples.

CycleGAN-tensorflow
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does This repo implements CycleGAN in TensorFlow, letting you train models that translate images from one domain to another—say, horses to zebras—without needing matched before-and-after pairs. You supply two folders of unrelated images; the network learns the mapping by cycling translations through a pair of adversarial generators and enforcing that a round-trip gets you roughly back where you started.

The interesting bit The “cycle consistency” constraint is the clever hinge: instead of hand-labeling pairs, the model penalizes itself if horse→zebra→horse doesn’t reconstruct the original horse. It’s a neat workaround for domains where paired data is impossible or tedious to collect.

Key highlights

  • Ships with a download_dataset.sh script covering 11 preset datasets (horse2zebra, monet2photo, iphone2dslr_flower, etc.)
  • Provides a pretrained horse↔zebra model via OneDrive link
  • Training and test entry points are a single main.py with --phase and --which_direction flags
  • TensorBoard logging baked in via ./logs
  • Explicitly targets TensorFlow r1.1 (yes, r1.1—this is vintage 2017)

Caveats

  • Dependencies are pinned to very old versions: TensorFlow r1.1, numpy 1.11.0, scipy 0.17.0. Expect friction on modern Python/TF stacks.
  • The README is minimal: no mention of hardware requirements, training time, or expected output quality beyond the sample images shown.
  • Several application sections (paintings, season transfer, photo enhancement) are commented out in the README, leaving only horse/zebra results on display.

Verdict Worth a look if you need a clean, minimal CycleGAN reference in TensorFlow 1.x or want to dissect the cycle-consistency mechanics without PyTorch abstractions. Skip it if you need production-ready code or a modern TF 2.x/Keras implementation—this is a period piece.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.