APDrawingGAN++ Jittor Implementation
April 19, 2021 ยท View on GitHub
We provide Jittor implementations for our TPAMI 2020 paper "Line Drawings for Face Portraits from Photos using Global and Local Structure based GANs". [Paper]
It is a journal extension of our previous CVPR 2019 work APDrawingGAN.
This project generates artistic portrait drawings from face photos using a GAN-based model.
Prerequisites
- Linux or macOS
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
Sample Results
Up: input, Down: output
Installation
- To install the dependencies, run
pip install -r requirements.txt
Apply pretrained model
-
- Download pre-trained models from BaiduYun(extract code: 9w83) and rename the folder to
checkpoints.
- Download pre-trained models from BaiduYun(extract code: 9w83) and rename the folder to
-
- Test for example photos: generate artistic portrait drawings for example photos in the folder
./samples/A_img/exampleusing models incheckpoints/apdrawinggan++_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/apdrawinggan++_author_150/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, the folder of foreground masks using--mask_folder, and the folder of compact masks using--cmask_folder, and run thetest.pyagain.
- To test on your own photos: First run preprocess here). Then specify the folder that contains test photos using option
Train
-
- Download the APDrawing dataset (augmented using histogram matching) from BaiduYun(extract code: sq62) and put the folder to
data/apdrawing++.
- Download the APDrawing dataset (augmented using histogram matching) from BaiduYun(extract code: sq62) and put the folder to
-
- Train our model (150 epochs)
python apdrawing_gan++.py
Models are saved in folder checkpoints/apdrawing++
-
- Test the trained model
python test.py --which_epoch 150 --model_name apdrawing++
Results are saved in ./results/portrait_drawing/apdrawing++_150/example
Citation
If you use this code or APDrawing dataset for your research, please cite our paper.
@inproceedings{YiXLLR20,
title = {Line Drawings for Face Portraits from Photos using Global and Local Structure based {GAN}s},
author = {Yi, Ran and Xia, Mengfei and Liu, Yong-Jin and Lai, Yu-Kun and Rosin, Paul L},
booktitle = {{IEEE} Transactions on Pattern Analysis and Machine Intelligence (TPAMI)},
doi = {10.1109/TPAMI.2020.2987931},
year = {2020}
}