- Linux or macOS
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
- Clone this repo:
git clone https://github.com/jolibrain/pytorch-CycleGAN-and-pix2pix
cd pytorch-CycleGAN-and-pix2pix
- Install PyTorch and other dependencies (torchvision, visdom and dominate, FID).
- For pip users, please type the command
pip install -r requirements.txt
.
- For pip users, please type the command
- Options :
Model | Network | Decoder |
---|---|---|
CycleGAN, CycleGAN_semantic, CycleGAN_semantic_mask | resnet, Unet, mobile_resnet | Vanilla, Sty2 |
- Train a cycleGAN :
You can tune the hyperparameters in ./scripts/train_cyclegan.sh
and then use the following line command.
bash ./scripts/train_cyclegan.sh
- Train a cycleGAN with labels :
You can tune the hyperparameters in ./scripts/train_cyclegan_semantic.sh
and then use the following line command.
bash ./scripts/train_cyclegan_semantic.sh
- Train a cycleGAN with mask labels :
You can tune the hyperparameters in ./scripts/train_cyclegan_semantic_mask.sh
and then use the following line command.
bash ./scripts/train_cyclegan_semantic_mask.sh
- Unaligned : apple2orange, horse2zebra
- Unaligned with labels : svhn2mnist
- Unaligned with mask labels : glasses2noglasses,
To choose a dataloader please use the flag --dataset_mode dataloader_name
.
There are three dataloaders for different dataset architectures :
- Unaligned (
unaligned
) - Unaligned with labels (
unaligned_labeled
) - Unaligned with mask labels (
unaligned_labeled_mask
)
Our code is inspired by pytorch-CycleGAN-and-pix2pix.