Implementation:Junyanz Pytorch CycleGAN and pix2pix Download Dataset
| Knowledge Sources | pytorch-CycleGAN-and-pix2pix |
|---|---|
| Domains | Image-to-Image Translation, Data Preparation, Benchmark Datasets |
| Last Updated | 2026-02-09 |
Overview
Shell scripts that download and unpack standard CycleGAN and pix2pix benchmark datasets from Berkeley servers. These are external tool documents (shell scripts, not Python modules).
Description
Two separate shell scripts handle dataset downloads for the two model families:
- download_cyclegan_dataset.sh -- Downloads CycleGAN datasets (unpaired image domains) as tar.gz archives
- download_pix2pix_dataset.sh -- Downloads pix2pix datasets (paired image translation) as tar.gz archives
Both scripts accept a dataset name as a command-line argument, construct the download URL, fetch the archive with wget, and extract it into the ./datasets/ directory.
Usage
Run from the repository root directory before training. One-time setup per dataset.
Code Reference
Source Location
| File | Lines |
|---|---|
| datasets/download_cyclegan_dataset.sh | L1-21 |
| datasets/download_pix2pix_dataset.sh | L1-22 |
Signature
# CycleGAN dataset download
# Usage: bash datasets/download_cyclegan_dataset.sh <dataset_name>
# Available datasets: apple2orange, horse2zebra, summer2winter_yosemite,
# monet2photo, cezanne2photo, ukiyoe2photo, vangogh2photo,
# maps, cityscapes, facades, iphone2dslr_flower, ae_photos
FILE=$1
URL="https://people.eecs.berkeley.edu/~taesung_park/CycleGAN/datasets/$FILE.zip"
wget -N $URL -O ./datasets/$FILE.zip
unzip ./datasets/$FILE.zip -d ./datasets/
rm ./datasets/$FILE.zip
# pix2pix dataset download
# Usage: bash datasets/download_pix2pix_dataset.sh <dataset_name>
# Available datasets: facades, cityscapes, maps, edges2shoes,
# edges2handbags, night2day
FILE=$1
URL="http://efrosgans.eecs.berkeley.edu/pix2pix/datasets/$FILE.tar.gz"
TAR_FILE=./datasets/$FILE.tar.gz
TARGET_DIR=./datasets/$FILE/
wget -N $URL -O $TAR_FILE
mkdir -p $TARGET_DIR
tar -zxvf $TAR_FILE -C ./datasets/
rm $TAR_FILE
Import
N/A -- These are shell scripts executed directly from the command line. They are not importable Python modules.
I/O Contract
| Parameter | Type | Description |
|---|---|---|
| dataset_name | string (CLI argument) | Name of the dataset to download (e.g., horse2zebra, facades) |
| Output | Type | Description |
|---|---|---|
| ./datasets/<dataset_name>/ | directory | Extracted dataset directory containing train/test subdirectories |
| ./datasets/<dataset_name>/trainA/ | directory | (CycleGAN) Training images from domain A |
| ./datasets/<dataset_name>/trainB/ | directory | (CycleGAN) Training images from domain B |
| ./datasets/<dataset_name>/testA/ | directory | (CycleGAN) Test images from domain A |
| ./datasets/<dataset_name>/testB/ | directory | (CycleGAN) Test images from domain B |
| ./datasets/<dataset_name>/train/ | directory | (pix2pix) Paired training images |
| ./datasets/<dataset_name>/test/ | directory | (pix2pix) Paired test images |
Usage Examples
# Download the horse2zebra CycleGAN dataset
bash datasets/download_cyclegan_dataset.sh horse2zebra
# Download the facades pix2pix dataset
bash datasets/download_pix2pix_dataset.sh facades
# After download, train CycleGAN on horse2zebra
python train.py --dataroot ./datasets/horse2zebra --name horse2zebra --model cycle_gan
# After download, train pix2pix on facades
python train.py --dataroot ./datasets/facades --name facades_pix2pix --model pix2pix --direction BtoA