Conditional-AnimeGAN
Conditional-AnimeGAN copied to clipboard
Conditional GAN for Anime face generation.
Conditional AnimeGAN
PyTorch implementation of conditional Generative Adversarial Network (cGAN) for Anime face generation conditioned on eye color and hair color.
Row-1: Brown Eyes Blonde Hair
Row-2: Blue Eyes Blue Hair
Row-3: Red Eyes Green Hair
Row-4: Purple Eyes Orange Hair
Row-5: Green Eyes Purple Hair
Row-6: Aqua Eyes Pink Hair
You can download the dataset from the following repo.
Training
Download the data and place it in the data/ directory. (Optional) Run prepro.py
to clean and preprocess the data. Run train.py
to start training. To change the hyperparameters of the network, update the values in the param
dictionary in train.py
.
Checkpoints will be saved by default in the checkpoint
directory every 2 epochs.
By deafult, GPU will be used for training if available. (Training on CPU is not recommended)
Loss Curve
Generating New Images
To generate new images run generate.py
.
python3 generate.py -load_path /path/to/pth/checkpoint -num_output n -eye_color c1 -hair_color c2
- Possible colors for eyes
['yellow', 'gray', 'blue', 'brown', 'red', 'green', 'purple', 'orange',
'black', 'aqua', 'pink', 'bicolored']
- Possible colors for hair
['gray', 'blue', 'brown', 'red', 'blonde', 'green', 'purple', 'orange',
'black', 'aqua', 'pink', 'white']
Results
Training Data | cDCGAN after 50 epochs |
![]() | ![]() |
Some Generated Samples:
Blue Eyes Blonde Hair
Red Eyes Blonde Hair
Green Eyes Purple Hair
Red Eyes Green Hair
Aqua Eyes Pink Hair
Red Eyes Purple Hair