This repository contains a PyTorch reimplementation of CycleGAN, and was used to transform human faces into anime faces.
With pip:
$ git clone https://github.com/charlesoblack/cyclegan
$ cd cyclegan/
$ pip3 install -r requirements.txt
With conda:
$ git clone https://github.com/charlesoblack/cyclegan
$ cd cyclegan/
$ conda env create -f environment.yml
$ conda activate cyclegan
The datasets used by this project consisted of human faces and anime faces. The human faces come from the Real and Fake Face Detection dataset(only the real faces were used). The anime faces were compiled by Mckinsey666 and can be found here.
The dataset directory should be structured as follows:
├── datasets
| ├── <dataset_name> # i.e. human2anime
| | ├── train # Training
| | | ├── A # Contains domain A images (i.e. human faces)
| | | └── B # Contains domain B images (i.e. anime faces)
| | └── test # Testing
| | | ├── A # Contains domain A images (i.e. human faces)
| | | └── B # Contains domain B images (i.e. anime faces)
$ cd src/
$ python3 train.py --dataset human2anime --name experiment1
If you want to load pre-trained weights or resume from a checkpoint, simply add the epoch to resume from:
# Example: human2anime dataset, experiment1 for epoch 100
$ python3 train.py --dataset human2anime --name experiment1 --starting-epoch 100
$ cd src/
$ python3 test.py --dataset human2anime --name experiment1