Skip to content

Jittor code for APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs (CVPR 2019 Oral)

Notifications You must be signed in to change notification settings

yiranran/APDrawingGAN-Jittor

Repository files navigation

APDrawingGAN Jittor Implementation

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.

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

    1. Download pre-trained models from BaiduYun(extract code: 9qhp) and rename the folder to checkpoints.
    1. Test for example photos: generate artistic portrait drawings for example photos in the folder ./samples/A/example using models in checkpoints/formal_author
python test.py

Results are saved in ./results/portrait_drawing/formal_author_300/example

    1. 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 the test.py again.

Train

    1. Download the APDrawing dataset from GoogleDrive and put the folder to data/apdrawing.
    1. Train our model (300 epochs)
python apdrawing_gan.py

Models are saved in folder checkpoints/apdrawing

    1. Test the trained model
python test.py --which_epoch 300 --model_name apdrawing

Results are saved in ./results/portrait_drawing/apdrawing_300/example

Citation

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}
}

About

Jittor code for APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs (CVPR 2019 Oral)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published