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)
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)
OverlapNet output (64x64) after 50k steps (From top to bottom: input / output / ground truth)
Vectorization output (64x64)
From left to right: input / raster / transparent / overlap / vector