All Projects → MarkMoHR → virtual_sketching

MarkMoHR / virtual_sketching

Licence: Apache-2.0 license
General Virtual Sketching Framework for Vector Line Art (SIGGRAPH 2021)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to virtual sketching

Anime2Sketch
A sketch extractor for anime/illustration.
Stars: ✭ 1,623 (+1362.16%)
Mutual labels:  sketch
sketch-pages-to-folders
Sketch plugin that exports all the artboards of a Sketch file into folders, which are based on the pages of the Sketch file.
Stars: ✭ 56 (-49.55%)
Mutual labels:  sketch
DeepPS
[ECCV 2020] "Deep Plastic Surgery: Robust and Controllable Image Editing with Human-Drawn Sketches"
Stars: ✭ 63 (-43.24%)
Mutual labels:  sketch
SketchStrap
SketchStrap - Bootstrap customizer
Stars: ✭ 42 (-62.16%)
Mutual labels:  sketch
sketch-data-cn
为 Sketch 准备的模拟数据中文版,包含:中文姓名,手机号,省份,城市,地区,公司名,银行名,星期几,详情地址,邮编,邮箱,颜色,广告词等。
Stars: ✭ 39 (-64.86%)
Mutual labels:  sketch
Sketch-Resize-Commands
A Sketch plugin that lets you resize and reposition objects by using simple arithmetic commands, like `b+20,lr+20`. Multiple objects are supported.
Stars: ✭ 32 (-71.17%)
Mutual labels:  sketch
library-replacer-sketchplugin
A Sketch plugin that allows you to replace a library in a Sketch file
Stars: ✭ 19 (-82.88%)
Mutual labels:  sketch
RemoveAllGuides
Plugin for Sketch App.
Stars: ✭ 21 (-81.08%)
Mutual labels:  sketch
glcic.pytorch
This is a implement of the Siggraph2017 paper: "Globally and Locally Consistent Image Completion"
Stars: ✭ 15 (-86.49%)
Mutual labels:  siggraph
KuiBaDB
Another OLAP database
Stars: ✭ 297 (+167.57%)
Mutual labels:  vectorization
public
Some public files that I can link to: icons, screenshots, etc.
Stars: ✭ 29 (-73.87%)
Mutual labels:  sketch
gql-sketch
💎 minimal graphql client for Sketch
Stars: ✭ 29 (-73.87%)
Mutual labels:  sketch
stark-sketch-plugin
Ensure your design is accessible and high contrast for every type of color blindness
Stars: ✭ 45 (-59.46%)
Mutual labels:  sketch
fasterRaster
Faster raster processing using GRASS GIS
Stars: ✭ 18 (-83.78%)
Mutual labels:  vectorization
qHilbert
qHilbert is a vectorized speedup of Hilbert curve generation using SIMD intrinsics
Stars: ✭ 22 (-80.18%)
Mutual labels:  vectorization
uiLogos-sketch-plugin
Sketch plugin to Insert professionally designed dummy logos of companies and 190+ country flag into SketchApp
Stars: ✭ 26 (-76.58%)
Mutual labels:  sketch
Sketch-Navigator
"Sketch Navigator lets you quickly jump to any specific artboard without having to scan the all too easily cluttered Layers List in the app’s left-hand pane." - Khoi Vinh
Stars: ✭ 160 (+44.14%)
Mutual labels:  sketch
context-sketch-plugin
Count character, words, and paragraphs from a text layer easily inside Sketch!
Stars: ✭ 13 (-88.29%)
Mutual labels:  sketch
Sketch-Interactions
Library for creating user flows and add visual connection with Jira tasks in Sketch
Stars: ✭ 40 (-63.96%)
Mutual labels:  sketch
Sketch-Highlighter
Sketch plugin that generates highlights for selected text layers
Stars: ✭ 41 (-63.06%)
Mutual labels:  sketch

General Virtual Sketching Framework for Vector Line Art - SIGGRAPH 2021

[Paper] | [Project Page] | [中文Readme] | [中文论文介绍]

This code is used for line drawing vectorization, rough sketch simplification and photograph to vector line drawing.

    

Outline

Dependencies

Testing with Trained Weights

Model Preparation

Download the models here:

  • pretrain_clean_line_drawings (105 MB): for vectorization
  • pretrain_rough_sketches (105 MB): for rough sketch simplification
  • pretrain_faces (105 MB): for photograph to line drawing

Then, place them in this file structure:

outputs/
    snapshot/
        pretrain_clean_line_drawings/
        pretrain_rough_sketches/
        pretrain_faces/

Usage

Choose the image in the sample_inputs/ directory, and run one of the following commands for each task. The results will be under outputs/sampling/.

python3 test_vectorization.py --input muten.png

python3 test_rough_sketch_simplification.py --input rocket.png

python3 test_photograph_to_line.py --input 1390.png

Note!!! Our approach starts drawing from a randomly selected initial position, so it outputs different results in every testing trial (some might be fine and some might not be good enough). It is recommended to do several trials to select the visually best result. The number of outputs can be defined by the --sample argument:

python3 test_vectorization.py --input muten.png --sample 10

python3 test_rough_sketch_simplification.py --input rocket.png --sample 10

python3 test_photograph_to_line.py --input 1390.png --sample 10

Reproducing Paper Figures: our results (download from here) are selected by doing a certain number of trials. Apparently, it is required to use the same initial drawing positions to reproduce our results.

Additional Tools

a) Visualization

Our vector output is stored in a npz package. Run the following command to obtain the rendered output and the drawing order. Results will be under the same directory of the npz file.

python3 tools/visualize_drawing.py --file path/to/the/result.npz 

b) GIF Making

To see the dynamic drawing procedure, run the following command to obtain the gif. Result will be under the same directory of the npz file.

python3 tools/gif_making.py --file path/to/the/result.npz 

c) Conversion to SVG

Our vector output in a npz package is stored as Eq.(1) in the main paper. Run the following command to convert it to the svg format. Result will be under the same directory of the npz file.

python3 tools/svg_conversion.py --file path/to/the/result.npz 
  • The conversion is implemented in two modes (by setting the --svg_type argument):
    • single (default): each stroke (a single segment) forms a path in the SVG file
    • cluster: each continuous curve (with multiple strokes) forms a path in the SVG file

Important Notes

In SVG format, all the segments on a path share the same stroke-width. While in our stroke design, strokes on a common curve have different widths. Inside a stroke (a single segment), the thickness also changes linearly from an endpoint to another. Therefore, neither of the two conversion methods above generate visually the same results as the ones in our paper. (Please mention this issue in your paper if you do qualitative comparisons with our results in SVG format.)


Training

Preparations

Download the models here:

  • pretrain_neural_renderer (40 MB): the pre-trained neural renderer
  • pretrain_perceptual_model (691 MB): the pre-trained perceptual model for raster loss

Download the datasets here:

  • QuickDraw-clean (14 MB): for clean line drawing vectorization. Taken from QuickDraw dataset.
  • QuickDraw-rough (361 MB): for rough sketch simplification. Synthesized by the pencil drawing generation method from Sketch Simplification.
  • CelebAMask-faces (370 MB): for photograph to line drawing. Processed from the CelebAMask-HQ dataset.

Then, place them in this file structure:

datasets/
    QuickDraw-clean/
    QuickDraw-rough/
    CelebAMask-faces/
outputs/
    snapshot/
        pretrain_neural_renderer/
        pretrain_perceptual_model/

Running

It is recommended to train with multi-GPU. We train each task with 2 GPUs (each with 11 GB).

python3 train_vectorization.py

python3 train_rough_photograph.py --data rough

python3 train_rough_photograph.py --data face

Citation

If you use the code and models please cite:

@article{mo2021virtualsketching,
  title   = {General Virtual Sketching Framework for Vector Line Art},
  author  = {Mo, Haoran and Simo-Serra, Edgar and Gao, Chengying and Zou, Changqing and Wang, Ruomei},
  journal = {ACM Transactions on Graphics (Proceedings of ACM SIGGRAPH 2021)},
  year    = {2021},
  volume  = {40},
  number  = {4},
  pages   = {51:1--51:14}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].