Coder Social home page Coder Social logo

jaedukseo / live-layerwise-image-vectorization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from picsart-ai-research/live-layerwise-image-vectorization

0.0 1.0 0.0 69.13 MB

[CVPR 2022 Oral] Towards Layer-wise Image Vectorization

Home Page: https://arxiv.org/abs/2206.04655

License: Apache License 2.0

Shell 0.06% C++ 32.26% Python 40.87% Perl 0.11% C 1.39% PowerShell 0.04% Cuda 23.70% Makefile 0.32% CMake 1.25%

live-layerwise-image-vectorization's Introduction

LIVE- Towards Layer-wise Image Vectorization (CVPR 2022 Oral)

Xu Ma, Yuqian Zhou, Xingqian Xu, Bin Sun, Valerii Filev, Nikita Orlov, Yun Fu, Humphrey Shi

arXiv, webpage, Open All Collab, Huggingface space

Primary contact: Xu Ma



We present a new method to progressively generate a SVG that fits the raster image in a layer-wise fashion. Given an arbitrary input image, LIVE recursively learns the visual concepts by adding new optimizable closed bezier paths and optimizing all these paths.



Elephant at sunset Elephant at sunset Elephant at sunset Elephant at sunset
From left to right are (1)input raster image, (2)output SVGs of DiffVG (path=5), (3)output SVGs of DiffVG (path=256), and (4)output of our LIVE (path=5). With only 5 paths, DiffVG cannot reconstruct the input image. When increasing the path number to 256 (which is significantly larger than the number of necessary paths), DiffVG is able to reconstruct the input. Differently, our LIVE is able to reconstruct the input smiling face by only 5 paths, and shows a compact layer-wise representation (We re-scale the speed to match the three gifs.).

Installation

We suggest users to use the conda for creating new python environment.

Requirement: 5.0<GCC<6.0; nvcc >10.0.

git clone [email protected]:ma-xu/LIVE.git
cd LIVE
conda create -n live python=3.7
conda activate live
conda install -y pytorch torchvision -c pytorch
conda install -y numpy scikit-image
conda install -y -c anaconda cmake
conda install -y -c conda-forge ffmpeg
pip install svgwrite svgpathtools cssutils numba torch-tools scikit-fmm easydict visdom
pip install opencv-python==4.5.4.60  # please install this version to avoid segmentation fault.

cd DiffVG
git submodule update --init --recursive
python setup.py install
cd ..

Run Experiments

conda activate live
cd LIVE
# Please modify the paramters accordingly.
python main.py --config <config.yaml> --experiment <experiment-setting> --signature <given-folder-name> --target <input-image> --log_dir <log-dir>
# Here is an simple example:
python main.py --config config/base.yaml --experiment experiment_5x1 --signature smile --target figures/smile.png --log_dir log/

Reference

@inproceedings{xu2022live,
    title={Towards Layer-wise Image Vectorization},
    author={Ma, Xu and Zhou, Yuqian and Xu, Xingqian and Sun, Bin and Filev, Valerii and  Orlov, Nikita and Fu, Yun and Shi, Humphrey},
    booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
    year={2022}
}

Acknowledgement

Our implementation is mainly based on the diffvg codebase. We gratefully thank the authors for their wonderful works.

LICENSE

LIVE is under the Apache-2.0 license. Please contact the authors for commercial use.

live-layerwise-image-vectorization's People

Contributors

ma-xu avatar honghuis 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.