• Stars
    star
    181
  • Rank 205,775 (Top 5 %)
  • Language
    MATLAB
  • License
    MIT License
  • Created about 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The source code of CVPR19 'Im2Pencil: Controllable Pencil Illustration from Photographs'.

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.