BachiLi / diffvg

Differentiable Vector Graphics Rasterization
https://people.csail.mit.edu/tzumao/diffvg/
Apache License 2.0
933 stars 156 forks source link

diffvg / pydiffvg on Colab? #75

Open gnmarten opened 9 months ago

gnmarten commented 9 months ago

I would be grateful for for an updated Google colab file that shows how to install/compile/run diffvg (if at all possible atm)

All extant colab files floating around on Github/the internet & utilising diffvg AFAIK no longer work due to

Some of the previous solutions don't/no longer work on Colab:

Thanks in advance.

tristanryerparke commented 7 months ago

I commented out the following line (134) in CMakeLists.txt on my fork: find_package(TensorFlow) Then installing on colab works for me with this cell:

!pip install svgwrite svgpathtools cssutils numba torch-tools visdom drawsvg
%cd /content/
!git clone https://github.com/tristanryerparke/diffvg
%cd diffvg
!git submodule update --init --recursive
!python setup.py install

import os
try:
  import pydiffvg
except:
  os.kill(os.getpid(), 9)

Keep in mind I'm only using diffvg with pytorch here, but running this cell (sometimes twice) works for me on colab.

JaeDukSeo commented 5 months ago

good