Home

Awesome

CartoonGAN

Torch implementation for Yang Chen, Yu-Kun Lai, Yong-Jin Liu. CartoonGAN: Generative Adversarial Networks for Photo Cartoonization, CVPR2018

This code borrows from early version of CycleGAN.

Installation

The same as CycleGAN

luarocks install nngraph
luarocks install class
luarocks install https://raw.githubusercontent.com/szym/display/master/display-scm-0.rockspec
git clone https://github.com/FlyingGoblin/CartoonGAN.git
cd CartoonGAN

Apply pre-trained Model

bash ./pretrained_models/download_model.sh
DATA_ROOT=./datasets/<your test data> name=Shinkai model=one_direction_test phase=test loadSize=256 fineSize=256 resize_or_crop="scale_width" th test.lua

Dataset

Train

DATA_ROOT=./datasets/<your data> name=<your name> th train.lua
DATA_ROOT=./datasets/<your data> name=<your name> init_model=<path to your init model> th train.lua

Test

DATA_ROOT=./datasets/<your test data> name=<your name> model=one_direction_test phase=test loadSize=256 fineSize=256 resize_or_crop="scale_width" th test.lua

BlaBla