Skip to content
The source code of CVPR19 'Im2Pencil: Controllable Pencil Illustration from Photographs'.
Branch: master
Clone or download
Latest commit 70ca648 Mar 26, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
extract_edge_tone Add files via upload Mar 26, 2019
models Delete networks.cpython-37.pyc Mar 26, 2019
options Delete __init__.cpython-37.pyc Mar 26, 2019
output Add files via upload Mar 26, 2019
pretrained_models init commit Mar 25, 2019
LICENSE Initial commit Mar 20, 2019
README.md Update README.md Mar 26, 2019
test.py init commit Mar 25, 2019

README.md

Im2Pencil

Pytorch implementation of our CVPR19 paper on controllable pencil illustration from photographs. More results and comparisons are shown here.

A line input (left) and two pencil outline results (middle: clean, right: rough)

A photo input (left) and four pencil shading results (right: [hatching, crosshatching; blending, stippling])

Getting started

git clone https://github.com/Yijunmaverick/Im2Pencil
cd Im2Pencil

Preparation

  • Download the pretrained models:
sh pretrained_models/download_models.sh
  • Extract the outline and tone image from the input photo (in MATLAB):
cd extract_edge_tone
Im2Pencil_get_edge_tone.m

Testing

  • Test with different outline and shading styles:
python test.py  --outline_style 1  --shading_style 1

Outline style: 0 for rough and 1 for clean

Shading style: 0, 1, 2, 3 for hatching, crosshatching, stippling, and blending respectively

For other controllable parameters, check options/test_options.py

Citation

@inproceedings{Im2Pencil-CVPR-2019,
    author = {Li, Yijun and Fang, Chen and Hertzmann, Aaron and Shechtman, Eli and Yang, Ming-Hsuan},
    title = {Im2Pencil: Controllable Pencil Illustration from Photographs},
    booktitle = {IEEE Conference on Computer Vision and Pattern Recognition},
    year = {2019}
}

Acknowledgement

  • We express gratitudes to the great work XDoG and Pix2Pix as we benefit a lot from both their paper and code.
You can’t perform that action at this time.