We provide Jittor implementations for our CVPR 2019 oral paper "APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs". [Paper]
This project generates artistic portrait drawings from face photos using a GAN-based model.
- Linux or macOS
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
Up: input, Down: output
- To install the dependencies, run
pip install -r requirements.txt
-
- Download pre-trained models from BaiduYun(extract code: 9qhp) and rename the folder to
checkpoints
.
- Download pre-trained models from BaiduYun(extract code: 9qhp) and rename the folder to
-
- Test for example photos: generate artistic portrait drawings for example photos in the folder
./samples/A/example
using models incheckpoints/formal_author
- Test for example photos: generate artistic portrait drawings for example photos in the folder
python test.py
Results are saved in ./results/portrait_drawing/formal_author_300/example
-
- To test on your own photos: First run preprocess here). Then specify the folder that contains test photos using option
--input_folder
, specify the folder of landmarks using--lm_folder
and the folder of masks using--mask_folder
, and run thetest.py
again.
- To test on your own photos: First run preprocess here). Then specify the folder that contains test photos using option
-
- Download the APDrawing dataset from GoogleDrive and put the folder to
data/apdrawing
.
- Download the APDrawing dataset from GoogleDrive and put the folder to
-
- Train our model (300 epochs)
python apdrawing_gan.py
Models are saved in folder checkpoints/apdrawing
-
- Test the trained model
python test.py --which_epoch 300 --model_name apdrawing
Results are saved in ./results/portrait_drawing/apdrawing_300/example
If you use this code or APDrawing dataset for your research, please cite our paper.
@inproceedings{YiLLR19,
title = {{APDrawingGAN}: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs},
author = {Yi, Ran and Liu, Yong-Jin and Lai, Yu-Kun and Rosin, Paul L},
booktitle = {{IEEE} Conference on Computer Vision and Pattern Recognition (CVPR '19)},
pages = {10743--10752},
year = {2019}
}