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.
From left to right: input, output(style1), output(style2), output(style3)
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)},
year = {2020}
}
- Linux or macOS
- Python 3
- CPU or NVIDIA GPU + CUDA CuDNN
- Install PyTorch 1.1.0 and torchvision from http://pytorch.org and other dependencies (e.g., visdom and dominate). You can install all the dependencies by
pip install -r requirements.txt
-
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.
A colab demo is here.
Our code is inspired by pytorch-CycleGAN-and-pix2pix.