tdh8316 / triangler Goto Github PK
View Code? Open in Web Editor NEW:triangular_ruler: Convert images to Low-Poly art using Delaunay triangulation.
License: MIT License
:triangular_ruler: Convert images to Low-Poly art using Delaunay triangulation.
License: MIT License
Broken for me:
>>> triangler_instance.convert_and_save("input.jpg", "output.jpg")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/anaconda3/lib/python3.8/site-packages/triangler/mod.py", line 89, in convert_and_save
im = Image.fromarray(self.convert(source).astype(np.uint8))
File "/opt/anaconda3/lib/python3.8/site-packages/triangler/mod.py", line 58, in convert
return process(
RuntimeWarning: Option -l or --reduce is temporarily unavailable due to the deprecated parameter multichannel of scikit-image.
As the title
Is your feature request related to a problem? Please describe.
Currently triangler requires numpy==1.22.4 scipy==1.8.1, or it won't run, but the systems I want to use it in require later versions of both numpy and scipy.
Describe the solution you'd like
Anyway you could adopt your functions to operate with more general or later versions?
Unused variable 'height'
width, height, c = _img_as_float.shape
Using type() instead of isinstance() for a typecheck.
if type(source) is str
Setup on macOS Ventura Apple Silicon, Python 3.11.5 venv (manually created)
installed in isolated venv using command:
python -m pip install git+https://github.com/tdh8316/triangler/
Error with PNG and JPEG:
python -m triangler -v apples.jpg
[2024-03-13 12:50:15][INFO] in main(): Options:Namespace(images=['apples.jpg'], output=None, sample='THRESHOLD', edge='SOBEL', blur=2, color='CENTROID', points=1024, reduce=False, verbose=True)
Converting /Users/astro/github/Triangler/apples.jpg...
Process Process-1:
Traceback (most recent call last):
File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
self.run()
File "/opt/homebrew/Cellar/[email protected]/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/astro/github/Triangler/lib/python3.11/site-packages/triangler/mod.py", line 89, in convert_and_save
im = Image.fromarray(self.convert(source).astype(np.uint8))
^^^^^^^^^^^^^^^^^^^^
File "/Users/astro/github/Triangler/lib/python3.11/site-packages/triangler/mod.py", line 58, in convert
return process(
^^^^^^^^
File "/Users/astro/github/Triangler/lib/python3.11/site-packages/numba/core/dispatcher.py", line 468, in _compile_for_args
error_rewrite(e, 'typing')
File "/Users/astro/github/Triangler/lib/python3.11/site-packages/numba/core/dispatcher.py", line 409, in error_rewrite
raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: Literal propagation)
Failed in literal_propagation_subpipeline mode pipeline (step: performs partial type inference)
Untyped global name 'imread': Cannot determine Numba type of <class 'function'>
File "lib/python3.11/site-packages/triangler/process.py", line 30:
def process(
<source elided>
if isinstance(img, str):
img = imread(img)
^
pip freeze output:
imageio==2.34.0
lazy_loader==0.3
llvmlite==0.42.0
networkx==3.2.1
numba==0.59.0
numpy==1.26.4
packaging==24.0
pillow==10.2.0
scikit-image==0.22.0
scipy==1.12.0
tifffile==2024.2.12
triangler @ git+https://github.com/tdh8316/triangler/@789b280a9c4fb7a593122d2dff783c82e509965f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.