Skip to content

CTLab-ITMO/LIVBOC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LIVBOC - Layerwise Image Vectorization via Bayesian-Optimized Contours (VISAPP 2025)

Ghfran Jabour, Sergey Muravyov, Valeria Efimova,

We introduce a new image vectorization method that generates SVG images from raster images with the help of Bayesian optimization algorithm to optimize key parameters for extracting contours and turning them into vectors, and the K-means algorithm to extract the suitable colors for these vectors. Then these vectors are optimized to properly align with the targeted shapes.



original Image


In the following image, from left to right we display:

  1. Input image in raster format.
  2. Vectors initialized by the Bayesian optimization and the K-means algorithms.
  3. Vectors being optimized to form the final output.

The image representing a girl is composed of 50 vectors, and the other one representing a deer is composed of 32 vectors.

original Image Vectors Initialized Vectors Optimization
original Image Vectors Initialized Vectors Optimization




Installation

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

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

git clone https://github.com/CTLab-ITMO/LIVBOC.git
conda create -n livboc python=3.10
conda activate livboc
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install -y numpy scikit-image
pip install scipy matplotlib scikit-optimize pyyaml pillow
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
cd DIFFVG
python setup.py install
cd ..

Run Experiments

conda activate livboc
cd LIVBOC
# 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_50 --signature girl4 --target figures/girl4.png.png --log_dir log/

Acknowledgement

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

LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.

About

Layerwise Image Vectorization via Bayesain-Optimized Contour

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •