Git Product home page Git Product logo

polyfit's Introduction

PolyFit: Clip-art vectorization

Code & Data for the SIGGRAPH 2020 paper PolyFit: Perception-Aligned Vectorization of Raster Clip-art via Intermediate Polygonal Fitting

The code has only been tested on Windows x64 with the Visual Studio 2017 compiler, for other platforms the active issue is here.

We have a pre-release executable available as well.

Building

git clone --recursive https://github.com/dedoardo/polyfit

Open the folder or CMake generated solution in Visual Studio (use a 2017 compiler) and build polyfit.exe in Release(WithDebInfo) mode, the output will be written to the cmake source directory.

Running

polyfit.exe "data/binary_input/pear-32/input.png" "trained/random_forest_paper.txt" curves-fill.svg

The output will be written to curves-fill.svg

If you are interested in visualizing different stages of the algorithm, build polyfit_stages.cpp instead and uncomment the respective lines relatives to the stages you are interested in visualizing. The usage is identical, except for the last argument which is a directory where the various stages will be written to as svgs.

Data

All the results shown in the paper and used in the user study are contained in the data directory.

If you want to generate all the results as shown in the paper, copy the polyfit.exe executable in the root directory and run the following Python3 script. Alternatively, you can obtain the executable from one of the releases.

python scripts/run_data_baseline.py

Dependencies

The code depends on the following libraries, but they should be handled automatically through git submodule.

Some of the known problems

  • Complex pixel-art will likely not work as the multicolor code hasn't been tested on it.
  • Visual Studio 2019 might not work, we encountered some problems with incorrect variable initialization.

TODOs

  • Add instructions for training data
  • Debug pixel-art

Contact

Feel free to reach out at edoaramis at gmail.com for questions regarding the code.

polyfit's People

Contributors

dedoardo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.