Skip to content
forked from taivu1998/GANime

A deep learning program that automatically generates colorized anime characters based on sketch drawings.

License

Notifications You must be signed in to change notification settings

bobyang9/GANime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GANime

This program implements several deep generative models for generating colorized anime characters based on sketch drawings. There are three main models used in this project, including Neural Style Transfer, Conditional GAN (Pix2Pix), and CycleGAN. [Paper] [Poster]

Demo

This section displays some outputs of the program. Each example contains an input image (left), a ground truth image (middle), and a generated image (right).

Installation

The project requires the following frameworks:

Download and preprocess data

This project uses the Anime Sketch Colorization Pair dataset from Kaggle. To get the data, go to https://www.kaggle.com/ktaebum/anime-sketch-colorization-pair, download the dataset, and unzip it in the data folder. Another option is to run the following command (with Kaggle API installed):

python utils/download_data.py

After that, run the following command to preprocess the data:

python utils/preprocess_data.py --model [model]

Train the models

  • Neural Style Transfer
python train.py --model neural_style_transfer --epochs 1000 --content-path /path/to/content/image/  --style-path /path/to/style/image/ --output-path /path/to/output/image/
  • Fast Neural Style Transfer
python train.py --model fast_neural_style_transfer --content-path /path/to/content/image/  --style-path /path/to/style/image/ --output-path /path/to/output/image/
  • Pix2Pix
python train.py --model pix2pix --epochs 150 --lr 2e-4 --batch-size 32 --data-path /path/to/dataset/ --resume --output-path /path/to/outputs/ --checkpoint-path /path/to/checkpoints/ 
  • CycleGAN
python train.py --model cyclegan --epochs 150 --lr 2e-4 --batch-size 8 --data-path /path/to/dataset/ --resume --output-path /path/to/outputs/ --checkpoint-path /path/to/checkpoints/ 

Test the models

  • Neural Style Transfer
python test.py --model neural_style_transfer --data-path /path/to/dataset/ --output-path /path/to/outputs/ 
  • Fast Neural Style Transfer
python test.py --model fast_neural_style_transfer --data-path /path/to/dataset/ --output-path /path/to/outputs/ 
  • Pix2Pix
python test.py --model pix2pix --data-path /path/to/dataset/ --output-path /path/to/outputs/ --checkpoint-path /path/to/checkpoints/ 
  • CycleGAN
python test.py --model cyclegan --data-path /path/to/dataset/ --output-path /path/to/outputs/ --checkpoint-path /path/to/checkpoints/ 

Evaluate the models

The program implements two evaluation metrics, including the Structural Similarity (SSIM) Index and the Frechet Inception Distance (FID). To evaluate the models, run the following command:

python evaluate.py --model [model] --metric [metric] --output-path /path/to/outputs/

Authors

  • Tai Vu - Stanford University

  • Robert Yang - Stanford University

Note: This project was collaboratively worked on in Google Colab / Google Drive and subsequently released on GitHub.

References

About

A deep learning program that automatically generates colorized anime characters based on sketch drawings.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%