yiranran / Unpaired-Portrait-Drawing

Code for Unpaired Portrait Drawing Generation via Asymmetric Cycle Mapping (CVPR 2020)
194 stars 35 forks source link

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". paper, suppl.

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

[Jittor implementation]

Our Proposed Framework

Sample Results

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

Prerequisites

Installation

Colab

A colab demo is here.

Test steps (apply a pretrained model)

# with GPU
python test_seq_style.py --dataroot [input_folder] --savefolder [save_folder_name]
# without GPU
python test_seq_style.py --gpu -1 --dataroot [input_folder] --savefolder [save_folder_name]
# E.g.
python test_seq_style.py --gpu -1 --dataroot ./imgs/test1 --savefolder 3styles_test1

The test results will be saved to a html file here: ./results/pretrained/test_200/index[save_folder_name].html. The result images are saved in ./results/pretrained/test_200/images[save_folder_name]. An example html screenshot is shown below:

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

Train steps

A subset of our training set is here.

Citation

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

@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)},
  pages     = {8214--8222},
  year      = {2020}
}

Acknowledgments

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