/Unpaired-Portrait-Drawing

Code for Unpaired Portrait Drawing Generation via Asymmetric Cycle Mapping (CVPR 2020)

Primary LanguagePython

Unpaired Portrait Drawing Generation via Asymmetric Cycle Mapping

We provide PyTorch implementations for our CVPR 2020 paper "Unpaired Portrait Drawing Generation via Asymmetric Cycle Mapping".

This project generates artistic portrait drawings from face photos using a GAN-based model.

Our Proposed Framework

Sample Results

From left to right: input, output(style1), output(style2), output(style3)

Citation

If you use this code for your research, please cite our paper.

paper, suppl.

@inproceedings{YiLLR20,
  title     = {Unpaired Portrait Drawing Generation via Asymmetric Cycle Mapping},
  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 '20)},
  year      = {2020}
}

Prerequisites

  • Linux or macOS
  • Python 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Installation

pip install -r requirements.txt

Apply a Pre-trained Model

  • Download a pre-trained model from BaiduYun(extract code:c9h7) or GoogleDrive and put it in checkpoints/pretrained.

  • Then generate artistic portrait drawings for example photos in examples using

python test_seq_style.py

The test results will be saved to a html file here: ./results/pretrained/test_200/indexstylex-x-x.html.

  • You could also test on your photos. The photos need to be square since the program will load it and resized as 512x512. An optional preprocess is here. Modify the 5th line in test_seq_style.py to your test folder and run the above command again.

You can contact email yr16@mails.tsinghua.edu.cn for any questions.

Colab

A colab demo is here.

Acknowledgments

Our code is inspired by pytorch-CycleGAN-and-pix2pix.