- CartoonGAN: Generative Adversarial Networks for Photo Cartoonization
- Deep Unsupervised Pixelization
- Python 3.5
- PIL
- Numpy
- Pytorch 0.4.0
- Torch
We collect 3000 portrait images and 900 pixel arts for traning our method. The folders named trainA
and trainB
contain the portrait images and pixel arts respectively. (aligned celeba, clip arts and pixel arts).
DUP's pretrained model is in ./checkpoints_pixelization
.
CartoonGAN's pretained models are in ./cartoonGan/pretrained_model
.
Create the folders testA
and testB
in a certain directory. Note that testA
and testB
contain the cartoon arts to be pixelized and pixel arts to be depixelized respectively.
Input natural images - portrait aligned celeba
- To train a model (DUP):
python3 ./train.py --dataroot ./samples --resize_or_crop resize_and_crop --gpu_ids 0
- After training, all models have been saved in the directory
./checkpoints_pixelization/
. - To test a model (DUP):
python3 ./test.py --dataroot ./samples --resize_or_crop resize_and_crop --gpu_ids 0 --how_many 1 --which_epoch 150 --loadSize 256
- To test a model (Pixelization of Natural Image via Cartoonization)
python ./main.py --loadSize 320
- Note :
main.py
will cartoonized portrait images in./input/natural_input
and output to./input/cartoon_input/testA
ThentestA
andtestB
in./input/cartoon_input
will be pixelized and depixelized respectivelty.
More testing flags in the file./options/base_options.py
.
All testing results will be shown in the directory./results_pixelization/
.