Skip to content

Jittor code for Line Drawings for Face Portraits from Photos using Global and Local Structure based GANs (TPAMI)

Notifications You must be signed in to change notification settings

yiranran/APDrawingGAN2-Jittor

Repository files navigation

APDrawingGAN++ Jittor Implementation

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.

PyTorch implementation

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: 9w83) and rename the folder to checkpoints.
    1. Test for example photos: generate artistic portrait drawings for example photos in the folder ./samples/A_img/example using models in checkpoints/apdrawinggan++_author
python test.py

Results are saved in ./results/portrait_drawing/apdrawinggan++_author_150/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, the folder of foreground masks using --mask_folder, and the folder of compact masks using --cmask_folder, and run the test.py again.

Train

    1. Download the APDrawing dataset (augmented using histogram matching) from BaiduYun(extract code: sq62) and put the folder to data/apdrawing++.
    1. Train our model (150 epochs)
python apdrawing_gan++.py

Models are saved in folder checkpoints/apdrawing++

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

About

Jittor code for Line Drawings for Face Portraits from Photos using Global and Local Structure based GANs (TPAMI)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published