/vectornet

Semantic Segmentation for Line Drawing Vectorization Using Neural Networks

Primary LanguageC++

Semantic Segmentation for Line Drawing Vectorization Using Neural Networks

Tensorflow implementation of Semantic Segmentation for Line Drawing Vectorization Using Neural Networks.

Byungsoo Kim¹, Oliver Wang², Cengiz Öztireli¹, Markus Gross¹

¹ETH Zurich, ²Adobe Research

Computer Graphics Forum (Proceedings of Eurographics 2018)

vectornet

Requirements

This code is tested on Windows 10 and Ubuntu 16.04 with the following requirements:

After installing anaconda, run pip install tensorflow-gpu cairosvg matplotlib imageio tqdm. In case of Potrace, unzip it (i.e. potrace/potrace.exe) on Windows or run sudo apt-get install potrace on Ubuntu.

Usage

Download a preprocessed dataset first and unzip it (i.e. data/ch/train).

To train PathNet on Chinese characters:

$ python main.py --is_train=True --archi=path --dataset=ch

To train OverlapNet on Chinese characters:

$ python main.py --is_train=True --archi=overlap --dataset=ch

To vectorize Chinese characters:

$ .\build_win.bat or ./build_linux.sh
$ python main.py --is_train=False --dataset=ch --load_pathnet=log/path/MODEL_DIR--load_overlapnet=log/overlap/MODEL_DIR

Results

PathNet output (64x64) after 50k steps (From top to bottom: input / output / ground truth)

path_ch_in

path_ch_50k

path_ch_gt

OverlapNet output (64x64) after 50k steps (From top to bottom: input / output / ground truth)

ov_ch_in

ov_ch_50k

ov_ch_gt

Vectorization output (64x64)

From left to right: input / raster / transparent / overlap / vector

vec_39693_in vec_39693_out vec_39693_t vec_39693_overlap vec_39693

Reference