GithubHelp home page GithubHelp logo

kevinjycui / desmosbezierrenderer Goto Github PK

View Code? Open in Web Editor NEW
563.0 563.0 100.0 39.91 MB

A simple image/video to Desmos graph converter run locally

Home Page: https://www.youtube.com/watch?v=BQvBq3K50u8

License: GNU General Public License v3.0

Python 58.12% HTML 41.88%

desmosbezierrenderer's Introduction

Desmos Bezier Renderer

A simple image/video to Desmos graph converter run locally. Rotoscopes images using Canny and Potrace edge detection as Bezier curves on Desmos Graphing Calculator.

Setup

This guide won't work out of the box on Windows. The easiest way to do this on Windows is to install WSL to run all the commands below. You can find it produces under the \\wsl$\Ubuntu-20.04\home path on your PC.

Install dependencies

sudo apt update
sudo apt install git python3-dev python3-pip build-essential libagg-dev libpotrace-dev pkg-config

Clone repository

git clone https://github.com/kevinjycui/DesmosBezierRenderer.git
cd DesmosBezierRenderer

Install requirements

python -m venv env
. env/bin/activate
pip install wheel
pip install -r requirements.txt

Replace the images in the frames directory with your own and name each image frame%d.png where %d represents the frame-number starting from 1. To render just a single image, add a single image named frame1.png in the directory. The renderer will work best with 360p to 480p resolution images (you may have to lower the resolution further with more complex frames).

rm -r frames
mkdir frames
...

Settings

Constants in the backend.py file can be changed to optimise or customise your render via command-line arguments.

$ python backend.py -h
backend.py -f <source> -e <extension> -c <colour> -b -d -l -g --yes --no-browser --size <widthxheight> --format <extension>

	-h			Get help

-Options

	-f <source>		The directory from which the frames are stored (e.g. frames)
	-e <extension>		The extension of the frame files (e.g. png)
	-c <colour>		The colour of the lines to be drawn (e.g. #2464b4)
	-b			Reduce number of lines with bilateral filter for simpler renders
	-d			Download rendered frames automatically
	-l			Reduce number of lines with L2 gradient for quicker renders
	-g			Hide the grid in the background of the graph

	--yes			Agree to EULA without input prompt
	--no-browser		Run renderer server without opening a web browser
	--size <widthxheight>	Dimensions for downloaded images (e.g. 3840x2160)
	--format <extension>	Specify format when downloading frames: "svg" or "png" (default is "png")

Use python backend.py -h to see the above help message. Run without any command-line arguments to create a rendering with the same settings as seen in this video.

Running the command

Run the backend (This may take a while depending on the size and complexity of the frames). It should eventually show that the server is running on http://127.0.0.1:5000 with the render available at http://127.0.0.1:5000/calculator.

python backend.py

The following is an example of the output:

$ python backend.py 
  _____                                
 |  __ \                               
 | |  | | ___  ___ _ __ ___   ___  ___ 
 | |  | |/ _ \/ __| '_ ` _ \ / _ \/ __|
 | |__| |  __/\__ \ | | | | | (_) \__ \
 |_____/ \___||___/_| |_| |_|\___/|___/

                   BEZIER RENDERER
Junferno 2021
https://github.com/kevinjycui/DesmosBezierRenderer

 = COPYRIGHT =
©Copyright Junferno 2021-2023. This program is licensed under the [GNU General Public License](https://github.com/kevinjycui/DesmosBezierRenderer/blob/master/LICENSE). Please provide proper credit to the author (Junferno) in any public media that uses this software. Desmos Bezier Renderer is in no way, shape, or form endorsed by or associated with Desmos, Inc.

 = EULA =
By using Desmos Bezier Renderer, you agree to comply to the [Desmos Terms of Service](https://www.desmos.com/terms). The Software and related documentation are provided “AS IS” and without any warranty of any kind. Desmos Bezier Renderer is not responsible for any User application or modification that constitutes a breach in terms. User acknowledges and agrees that the use of the Software is at the User's sole risk. The developer kindly asks Users to not use Desmos Bezier Renderer to enter into Desmos Math Art competitions, for the purpose of maintaining fairness and integrity.

                                      Agree (y/n)? y
-----------------------------
Processing 513 frames... Please wait for processing to finish before running on frontend

--> Processing complete in 4.5 seconds

		===========================================================================
		|| GO CHECK OUT YOUR RENDER NOW AT:					 ||
		||			http://127.0.0.1:5000/calculator		 ||
		===========================================================================

=== SERVER LOG (Ignore if not dev) ===
 * Serving Flask app 'backend'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://127.0.0.1:5000
Press CTRL+C to quit

Load http://127.0.0.1:5000/calculator into a web browser and put f=1 into the first formula in the formula window. The image should start rendering or the video should start playing at a slow rate.

Copyright

©Copyright Junferno 2021-2023. This program is licensed under the GNU General Public License. Please provide proper credit to the author (Junferno) in any public media that uses this software. Desmos Bezier Renderer is in no way, shape, or form endorsed by or associated with Desmos, Inc.

EULA

By using Desmos Bezier Renderer, you agree to comply to the [Desmos Terms of Service](https://www.desmos.com/terms). The Software and related documentation are provided “AS IS” and without any warranty of any kind. Desmos Bezier Renderer is not responsible for any User application or modification that constitutes a breach in terms. User acknowledges and agrees that the use of the Software is at the User's sole risk. The developer kindly asks Users to not use Desmos Bezier Renderer to enter into Desmos Math Art competitions, for the purpose of maintaining fairness and integrity.

desmosbezierrenderer's People

Contributors

33foo avatar buthed010203 avatar dependabot[bot] avatar kevinjycui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desmosbezierrenderer's Issues

error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

Hey, I have the path at frames\frame%d.png, but it still isn't working. Everything is a png. Everything is in "frames". IDK what's wrong with it.

`Traceback (most recent call last):

File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))

File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))

File "backend.py", line 118, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):

File "backend.py", line 92, in get_latex
path = get_trace(get_contours(filename))

File "backend.py", line 62, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'`

Fail to draw graph

So I have setup a virtual machine, install all requirements in right version, then I have two png file, each file is a graph. I'm using it to find if it have any function suit with those graph, but when app gave me two image, nothing in it except white.

ModulenotfoundError and "Could not finnd a version that satisfies error"

typing import potrace in python 3.11 shows module not found error.
when I try to install it pip3 install --user potrace
it shows ERROR: Could not find a version that satisfies the requirement potrace (from versions: none)
ERROR: No matching distribution found for potrace

I have been doing this stuff for the first time and i am basically a noob. Kind folks , please help

backend.py Not working

Backend.py is giving me the following error

` Processing 1 frames... Please wait for processing to finish before running on frontend

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "backend.py", line 87, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
File "backend.py", line 62, in get_latex
path = get_trace(get_contours(filename))
File "backend.py", line 36, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "backend.py", line 107, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor' `

Did I do something wrong?

ModuleNotFoundError: No Module named 'flask'

I can't figure out why it is not working. I have uninstalled and installed the requirements folder but it still does not work. i think it cant find any module because all the external module have yellow underlines. Also i am very new to python and html.

Possible things to add

An option to show equations like this
image
instead of this
image
also, the graph disappears a few seconds after it is finished rendering, even if there is only one frame, so that's kind of annoying
and an option to make it output a file with all of the equations(with end lines after each), so its possible to copy and paste it into online desmos

Freeze_support() error

Hi I keep getting this error:

RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

Missine lines

I tried rendering the same sample image and got this. I tried playing around the parameters in the backend but nothing much changed.
image

error at frontend

The entire process worked properly, but when loading index.html there are no results, I got an idea to do inspect and see console, and that was showing this error:

index.html:29 GET http://127.0.0.1:5000/init net::ERR_SOCKET_NOT_CONNECTED
(anonymous) @ index.html:29

any help?

Error with potrace

I get this error whenever I run backend.py
AttributeError: module 'potrace' has no attribute 'TURNPOLICY_MINORITY'
any way to fix this?

Potential fix for ugly doublelines

Have you considered using a centerline tracing library to vectorize the OpenCV contour bitmaps? Centerline would create a single line in the center of each stroke instead of the ugly doublelines that you are getting with Potrace.

Really liked your youtube video btw!

How does the html file work?

I ran the backend and opened the html file in my browser but I didn't understand how to get it running. I wrote f=1 in the first formula line but nothing happened. I also tried pressing the play button next to f=0 but that just created a loop with f constantly increasing and decreasing. Could you please help me with this?
Screenshot 2021-05-10 202124

Error running backend.py

Traceback (most recent call last):
File "backend.py", line 8, in <module>
import potrace
File "/home/sargo/.local/lib/python3.8/site-packages/potrace/__init__.py", line 1, in <module>
from potrace._potrace import * # NOQA
File "potrace/_potrace.pyx", line 1, in init potrace._potrace
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

Issue in backend.py usind .bmp images

Full error traceback:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "backend.py", line 118, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
File "backend.py", line 92, in get_latex
path = get_trace(get_contours(filename))
File "backend.py", line 62, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "backend.py", line 208, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

Instead of using png images I'd used bmp images. In backend.py I changed value of File_Exit = bmp and wrote down full path to frame folder in Frame_Dir. Excuse me for my bad English, hope that somebody can help me with my problem

error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

whenever i try to run backend.py i get the following error:

Desmos Bezier Renderer
Junferno 2021
https://github.com/kevinjycui/DesmosBezierRenderer

Processing 1 frames... Please wait for processing to finish before running on frontend

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "backend.py", line 87, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
File "backend.py", line 62, in get_latex
path = get_trace(get_contours(filename))
File "backend.py", line 36, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "backend.py", line 108, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

ive installed all the dependencies and did a fresh restart of the entire process a few times.
im using a linux mint virtual machine

NameError: name 'frame' is not defined

Traceback (most recent call last):
File "/Users/userdir/DesmosBezierRenderer/backend.py", line 108, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/Users/userdir/bin/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/Users/userdir/bin/homebrew/Cellar/[email protected]/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/pool.py", line 771, in get
raise self._value
NameError: name 'frame' is not defined

Unable to process file

I followed the instructions and replaced all the original frames in the frames directory with a frame1.png file.
And I got an error

Processing 1 frames... Please wait for processing to finish before running on frontend

[ERROR] Unable to process one or more files. Remember image files should be named <DIRECTORY>/frame<INDEX>.<EXTENSION> where INDEX represents the frame number starting from 1 and DIRECTORY and EXTENSION are defined by command line arguments (e.g. frames/frame1.png). Please check if:
        The files exist
        The files are all valid image files
        The name of the files given is correct as per command line arguments
        The program has the necessary permissions to read the file.

Use backend.py -h for further documentation
-----------------------------
Full error traceback:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "backend.py", line 118, in get_expressions
    for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
  File "backend.py", line 92, in get_latex
    path = get_trace(get_contours(filename))
  File "backend.py", line 62, in get_contours
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "backend.py", line 208, in <module>
    frame_latex = pool.map(get_expressions, frame_latex)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

I still got the same error when I put back the original files (I saved them just in case)

Taking sooo much time to render in HTML

HIi bro, thanks for your advice, Ive reached the final step, everything is done, the only problem it is taking lot of time for the images to appear in desmos html and images having greater file size aren't appearing at all.
Please help when you have time

Desmos unloads the rendered image

Hi! I have been trying to run the program via WSL for sometime now, but i can't figure out why desmos keeps removing the image. After starting backend.py, I boot up the index.html, and put f=1 in the equation, to which Desmos responds with l="some value" and starts the render. But, after a couple of seconds, the l value returns to 0, and the whole desmos graph is back to empty (I have read in a issue post that a download prompt appears, but nothing of that sort happens for me). I can guarantee the image starts rendering, but disappears suddenly.

Is there something I am doing wrong? Any help would be much appreciated.

Blank Desmos Page

After getting rid of all errors, when I set f=1 on the page, the grid lines remove, but the page is blank. Im using the sample image provided in the github folder.
The screenshot after is also blank.
What could be the issue?

Difficulty adding images to 'frames' directory

I am a complete beginner, so please forgive the stupidity.
I'm working on a windows system. WSL is downloaded, but I can't figure out how to put files from a windows directory (a folder on my desktop) to a directory that I can call with this code.
README says to create a directory:
mkdir frames ...
but not how to add files to it.
Again any help is much appreciated.

request.args.get('frame') returning NoneType?

Traceback (most recent call last):
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
    response = self.handle_exception(e)
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/dominic/DesmosBezierRenderer/env/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/dominic/DesmosBezierRenderer/backend.py", line 96, in index
    frame = int(request.args.get('frame'))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

I assume request.args.get('frame') is returning a NoneType , since int( ) is getting a TypeError.

Could it be that I named my files wrongly?
I created the frames directory and inside frames i added a file frame1.png.

my directory:

  • DesmosBezierRenderer
    • frames
      • frame1.png
    • desmos
    • env
    • github
    • backend.py
    • index.html
    • requirements.txt

cannot unpack non-iterable _Point object

for segment in segments:
x0, y0 = start
hey bro please help me here, after running the code, traceback is showing a type error at this line saying cannot unpack non-iterable _Point object.

x0, y0 = start
^^^^^^

Feature To Add - Export to Desmos Website

Hi guys, Great project! One feature I would suggest is to add the option to export the official Desmos website - so one can save a frame as a file - and then share it with people????
Regards,

running html file gives Error code: RESULT_CODE_KILLED_BAD_MESSAGE on windows

After following the guide provided, I tried running the index.html file to render an image, yet every time I do so, it kills the page and gives me Error code: RESULT_CODE_KILLED_BAD_MESSAGE.
The only thing I have done differently is update numpy so that I could avoid an error with potrace, and it seems to have worked fine with it updated, yet it could possibly be the issue. Is there any other issue I could be running into that could cause the error?

Error Running backend

i have been trying to run the backen to render a single immage but keep getting this error:

Desmos Bezier Renderer
Junferno 2021
https://github.com/kevinjycui/DesmosBezierRenderer
-----------------------------
Processing 2 frames... Please wait for processing to finish before running on frontend

[ WARN:[email protected]] global /io/opencv/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('frames/frame2.png'): can't open/read file: check file path/integrity
--> Frame 1/2[ERROR] Unable to process one or more files. Remember image files should be named <DIRECTORY>/frame<INDEX>.<EXTENSION> where INDEX represents the frame number starting from 1 and DIRECTORY and EXTENSION are defined by command line arguments (e.g. frames/frame1.png). Please check if:
        The files exist
        The files are all valid image files
        The name of the files given is correct as per command line arguments
        The program has the necessary permissions to read the file.

Use backend.py -h for further documentation

-----------------------------
Full error traceback:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "backend.py", line 118, in get_expressions
    for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
  File "backend.py", line 92, in get_latex
    path = get_trace(get_contours(filename))
  File "backend.py", line 62, in get_contours
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "backend.py", line 208, in <module>
    frame_latex = pool.map(get_expressions, frame_latex)
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
cv2.error: OpenCV(4.5.5) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

the image i am trying to render is:
frame1

calculator html issue

the development server wont work

This 127.0.0.1 page can’t be found
No webpage was found for the web address: http://127.0.0.1:5000/calculator
HTTP ERROR 404

it just says that when i opened the address
also the same when i removed the /calculator

backend.py doesn't work

Whenever I run "python3 backend.py", everything seems to be fine, but it just never changes or loads anything new, here's what I get:

Desmos Bezier Renderer
Junferno 2021
https://github.com/kevinjycui/DesmosBezierRenderer

Processing 1 frames... Please wait for processing to finish before running on frontend

--> Processing complete in 0.0 seconds

  • Serving Flask app "backend" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

I'm using WSL 2 on Windows 10, and I've reinstalled both that and the code multiple times, are there any steps that I'm missing?

It reports error

I did it in WSL. It report
txwg@DESKTOP-P3TFQTF:~/DesmosBezierRenderer$ python3 backend.py
Traceback (most recent call last):
File "/home/txwg/DesmosBezierRenderer/backend.py", line 10, in
import cv2
File "/home/txwg/.local/lib/python3.10/site-packages/cv2/init.py", line 181, in
bootstrap()
File "/home/txwg/.local/lib/python3.10/site-packages/cv2/init.py", line 153, in bootstrap
native_module = importlib.import_module("cv2")
File "/usr/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
requirements.txt

(I just random chose a file to upload, please do not mind)

backend.py stopping at ~37% the way through

When running with 3990 frames, it stopped at 1500 frames. I then proceeded to delete frames 1501-3990 and then ran it again. It stopped at frame 564. I checked task manager and CPU usage and ram usage dropped steadily after it stopped. I then proceeded to try to make it so 3990 was 37% of the frames, adding about 7000 empty images. Instead, it stopped at ~2500. I tried recloning the respiratory and redoing the ffmpeg, but the issue still remained.

automatically refreshing?

I have resized the image, thinking it will help, but the tab just keeps refreshing. How do I prevent it from automatically refreshing?

NameError: name 'height' is not defined

Error when running backend.py and then entering f = 1 in the formula field (in the index.html). Here's the error traceback (500 error):
[2021-07-04 19:20:40,644] ERROR in app: Exception on /init [GET] Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask_cors/extension.py", line 165, in wrapped_function return cors_after_request(app.make_response(f(*args, **kwargs))) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise raise value File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/Users/codingdanny/projects/fun/DesmosBezierRenderer/backend.py", line 141, in init return json.dumps({'height': height.value, 'width': width.value, 'total_frames': len(os.listdir(FRAME_DIR)), 'download_images': DOWNLOAD_IMAGES, 'show_grid': SHOW_GRID}) NameError: name 'height' is not defined 127.0.0.1 - - [04/Jul/2021 19:20:40] "GET /init HTTP/1.1" 500 -

Can't change frames used

I've followed the instructions completely and have gotten demos to full render the frames included, however I cannot replace the frames directory with my own images.

Backend error

I'm using wsl and running the command "python3 backend.py". and I get this error:

Desmos Bezier Renderer
Junferno 2021
https://github.com/kevinjycui/DesmosBezierRenderer

Processing 513 frames... Please wait for processing to finish before running on frontend

--> Processing complete in 6.9 seconds

  • Serving Flask app "backend" (lazy loading)
  • Environment: production
    WARNING: This is a development server. Do not use it in a production deployment.
    Use a production WSGI server instead.
  • Debug mode: off
  • Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
    127.0.0.1 - - [29/Jul/2022 16:48:50] "GET /init HTTP/1.1" 200 -
    [2022-07-29 16:48:59,070] ERROR in app: Exception on / [GET]
    Traceback (most recent call last):
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask_cors/extension.py", line 165, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/_compat.py", line 39, in reraise
    raise value
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
    File "/home/user/DesmosBezierRenderer/env/lib/python3.10/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functionsrule.endpoint
    File "/home/user/DesmosBezierRenderer/backend.py", line 126, in index
    frame = int(request.args.get('frame'))
    TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

continuation of #4
#4 worked and I installed potrace but when i ran backend.py it came up with a new error

Traceback (most recent call last):
  File "backend.py", line 77, in <module>
    frame_latex.append(get_latex(FRAME_DIR + '/frame%d.png' % (i+1)))
  File "backend.py", line 51, in get_latex
    path = get_trace(get_contours(filename))
  File "backend.py", line 29, in get_contours
    gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

pls help me

srry about all the issues

Backend script not working

When I followed the steps, backend.py does not start. After running python3 backend.py, it doesn't log anything. After moving app.run() up a little, it starts running. When I try to run the html, it returns a 404 error trying to run init and throws this error
uncaught SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) at XMLHttpRequest.xhr.onload (desmos.html:27)
Did I do something wrong?

ERROR: Could not build wheels for pypotrace which use PEP 517 and cannot be installed directly

The issue arises when I do pip install -r requirements.txt(note pip3 returns same results) the full results are:

Requirement already satisfied: click==7.1.2 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 1)) (7.1.2)
Requirement already satisfied: cycler==0.10.0 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 2)) (0.10.0)
Requirement already satisfied: Flask==1.1.2 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 3)) (1.1.2)
Collecting Flask-Cors==3.0.10
  Using cached Flask_Cors-3.0.10-py2.py3-none-any.whl (14 kB)
Requirement already satisfied: itsdangerous==1.1.0 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 5)) (1.1.0)
Requirement already satisfied: Jinja2==2.11.3 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 6)) (2.11.3)
Requirement already satisfied: kiwisolver==1.3.1 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 7)) (1.3.1)
Requirement already satisfied: MarkupSafe==1.1.1 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 8)) (1.1.1)
Requirement already satisfied: matplotlib==3.4.1 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 9)) (3.4.1)
Requirement already satisfied: numpy==1.20.2 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 10)) (1.20.2)
Collecting opencv-python==4.5.1.48
  Using cached opencv_python-4.5.1.48-cp38-cp38-manylinux2014_x86_64.whl (50.4 MB)
Requirement already satisfied: Pillow==8.2.0 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 12)) (8.2.0)
Requirement already satisfied: pyparsing==2.4.7 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 13)) (2.4.7)
Collecting pypotrace==0.3
  Using cached pypotrace-0.3.tar.gz (11 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Requirement already satisfied: python-dateutil==2.8.1 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 15)) (2.8.1)
Requirement already satisfied: six==1.15.0 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 16)) (1.15.0)
Requirement already satisfied: Werkzeug==1.0.1 in /opt/virtualenvs/python3/lib/python3.8/site-packages (from -r requirements.txt (line 17)) (1.0.1)
Building wheels for collected packages: pypotrace
  Building wheel for pypotrace (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /opt/virtualenvs/python3/bin/python3 /opt/virtualenvs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpj5jn8i1v
       cwd: /tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10
  Complete output (37 lines):
  A setup.py file already exists. Using it.
  Package libagg was not found in the pkg-config search path.
  Perhaps you should add the directory containing `libagg.pc'
  to the PKG_CONFIG_PATH environment variable
  No package 'libagg' found
  Traceback (most recent call last):
    File "/tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10/setup.py", line 28, in <module>
      build(setup_kwargs)
    File "/tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10/build.py", line 19, in build
      extra_compile_args = pkg_config("libagg", '--cflags')
    File "/tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10/build.py", line 11, in pkg_config
      return subprocess.check_output(["pkg-config", command, pkg_name]).decode(
    File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/lib/python3.8/subprocess.py", line 516, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['pkg-config', '--cflags', 'libagg']' returned non-zero exit status 1.
  Traceback (most recent call last):
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 280, in <module>
      main()
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 263, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/opt/virtualenvs/python3/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 204, in build_wheel
      return _build_backend().build_wheel(wheel_directory, config_settings,
    File "/tmp/pip-build-env-bkf4597c/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 68, in build_wheel
      return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory)))
    File "/tmp/pip-build-env-bkf4597c/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 72, in make_in
      wb.build()
    File "/tmp/pip-build-env-bkf4597c/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 103, in build
      self._build(zip_file)
    File "/tmp/pip-build-env-bkf4597c/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 135, in _build
      self._run_build_command(setup)
    File "/tmp/pip-build-env-bkf4597c/overlay/lib/python3.8/site-packages/poetry/core/masonry/builders/wheel.py", line 163, in _run_build_command
      subprocess.check_call(
    File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['/opt/virtualenvs/python3/bin/python3', '/tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10/setup.py', 'build', '-b', '/tmp/pip-install-ijqkzuo5/pypotrace_e778e9c007494dd781d506bbbd0e5d10/build']' returned non-zero exit status 1.
  ----------------------------------------
  ERROR: Failed building wheel for pypotrace
Failed to build pypotrace
ERROR: Could not build wheels for pypotrace which use PEP 517 and cannot be installed directly

I've tried stuff I've found including
updating pip3/pip
pip install p5py pip install PEP517
pip install --upgrade pip setuptools wheel
and a few others i don't remember

Any help is appreciated!

*Note: i don't have much experience with pip

I can't seem to install all the requirements

Hereis the output from thepip3 install -r requirements.txt`

(env) armstrong@NathansPC:~/DesmosBezierRenderer$ pip install -r requirements.txt
Collecting click==7.1.2
Using cached click-7.1.2-py2.py3-none-any.whl (82 kB)
Collecting cycler==0.10.0
Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting Flask==1.1.2
Using cached Flask-1.1.2-py2.py3-none-any.whl (94 kB)
Requirement already satisfied: Flask-Cors==3.0.10 in ./env/lib/python3.10/site-packages (from -r requirements.txt (line 4)) (3.0.10)
Collecting itsdangerous==1.1.0
Using cached itsdangerous-1.1.0-py2.py3-none-any.whl (16 kB)
Collecting Jinja2==2.11.3
Using cached Jinja2-2.11.3-py2.py3-none-any.whl (125 kB)
Collecting kiwisolver==1.3.1
Using cached kiwisolver-1.3.1.tar.gz (53 kB)
Preparing metadata (setup.py) ... done
Collecting MarkupSafe==1.1.1
Using cached MarkupSafe-1.1.1.tar.gz (19 kB)
Preparing metadata (setup.py) ... done
Collecting matplotlib==3.4.1
Using cached matplotlib-3.4.1.tar.gz (37.3 MB)
Preparing metadata (setup.py) ... done
Collecting numpy==1.23.0
Using cached numpy-1.23.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.0 MB)
Collecting opencv-python==4.5.1.48
Using cached opencv-python-4.5.1.48.tar.gz (88.3 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [323 lines of output]
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.6" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64"' don't match your environment
Collecting setuptools
Using cached setuptools-67.6.0-py3-none-any.whl (1.1 MB)
Collecting wheel
Using cached wheel-0.38.4-py3-none-any.whl (36 kB)
Collecting scikit-build
Using cached scikit_build-0.16.7-py3-none-any.whl (79 kB)
Collecting cmake
Using cached cmake-3.25.2-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (23.7 MB)
Collecting pip
Using cached pip-23.0.1-py3-none-any.whl (2.1 MB)
Collecting numpy==1.19.3
Using cached numpy-1.19.3.zip (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error

    × Preparing metadata (pyproject.toml) did not run successfully.
    │ exit code: 1
    ╰─> [286 lines of output]
        setup.py:67: RuntimeWarning: NumPy 1.19.3 may not yet support Python 3.10.
          warnings.warn(
        Running from numpy source directory.
        setup.py:480: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
          run_build = parse_setuppy_commands()
        Processing numpy/random/_bounded_integers.pxd.in
        Processing numpy/random/_generator.pyx
        Processing numpy/random/_sfc64.pyx
        Processing numpy/random/_common.pyx
        Processing numpy/random/mtrand.pyx
        Processing numpy/random/_mt19937.pyx
        Processing numpy/random/bit_generator.pyx
        Processing numpy/random/_philox.pyx
        Processing numpy/random/_bounded_integers.pyx.in
        Processing numpy/random/_pcg64.pyx
        Cythonizing sources
        blas_opt_info:
        blas_mkl_info:
        customize UnixCCompiler
          libraries mkl_rt not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        blis_info:
          libraries blis not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        openblas_info:
          libraries openblas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        atlas_3_10_blas_threads_info:
        Setting PTATLAS=ATLAS
          libraries tatlas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        atlas_3_10_blas_info:
          libraries satlas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        atlas_blas_threads_info:
        Setting PTATLAS=ATLAS
          libraries ptf77blas,ptcblas,atlas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        atlas_blas_info:
          libraries f77blas,cblas,atlas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        accelerate_info:
          NOT AVAILABLE
  
        /tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/system_info.py:1914: UserWarning:
            Optimized (vendor) Blas libraries are not found.
            Falls back to netlib Blas library which has worse performance.
            A better performance should be easily gained by switching
            Blas library.
          if self._calc_info(blas):
        blas_info:
          libraries blas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        /tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/system_info.py:1914: UserWarning:
            Blas (http://www.netlib.org/blas/) libraries not found.
            Directories to search for the libraries can be specified in the
            numpy/distutils/site.cfg file (section [blas]) or by setting
            the BLAS environment variable.
          if self._calc_info(blas):
        blas_src_info:
          NOT AVAILABLE
  
        /tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/system_info.py:1914: UserWarning:
            Blas (http://www.netlib.org/blas/) sources not found.
            Directories to search for the sources can be specified in the
            numpy/distutils/site.cfg file (section [blas_src]) or by setting
            the BLAS_SRC environment variable.
          if self._calc_info(blas):
          NOT AVAILABLE
  
        non-existing path in 'numpy/distutils': 'site.cfg'
        lapack_opt_info:
        lapack_mkl_info:
          libraries mkl_rt not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        openblas_lapack_info:
          libraries openblas not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        openblas_clapack_info:
          libraries openblas,lapack not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        flame_info:
          libraries flame not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        atlas_3_10_threads_info:
        Setting PTATLAS=ATLAS
          libraries lapack_atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries tatlas,tatlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries tatlas,tatlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/lib64
          libraries tatlas,tatlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib
          libraries tatlas,tatlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
          libraries tatlas,tatlas not found in /usr/lib/x86_64-linux-gnu
        <class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
          NOT AVAILABLE
  
        atlas_3_10_info:
          libraries lapack_atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries satlas,satlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries satlas,satlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/lib64
          libraries satlas,satlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib
          libraries satlas,satlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
          libraries satlas,satlas not found in /usr/lib/x86_64-linux-gnu
        <class 'numpy.distutils.system_info.atlas_3_10_info'>
          NOT AVAILABLE
  
        atlas_threads_info:
        Setting PTATLAS=ATLAS
          libraries lapack_atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries ptf77blas,ptcblas,atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries ptf77blas,ptcblas,atlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/lib64
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
          libraries ptf77blas,ptcblas,atlas not found in /usr/lib/x86_64-linux-gnu
        <class 'numpy.distutils.system_info.atlas_threads_info'>
          NOT AVAILABLE
  
        atlas_info:
          libraries lapack_atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries f77blas,cblas,atlas not found in /home/armstrong/DesmosBezierRenderer/env/lib
          libraries lapack_atlas not found in /usr/local/lib
          libraries f77blas,cblas,atlas not found in /usr/local/lib
          libraries lapack_atlas not found in /usr/lib64
          libraries f77blas,cblas,atlas not found in /usr/lib64
          libraries lapack_atlas not found in /usr/lib
          libraries f77blas,cblas,atlas not found in /usr/lib
          libraries lapack_atlas not found in /usr/lib/x86_64-linux-gnu
          libraries f77blas,cblas,atlas not found in /usr/lib/x86_64-linux-gnu
        <class 'numpy.distutils.system_info.atlas_info'>
          NOT AVAILABLE
  
        lapack_info:
          libraries lapack not found in ['/home/armstrong/DesmosBezierRenderer/env/lib', '/usr/local/lib', '/usr/lib64', '/usr/lib', '/usr/lib/x86_64-linux-gnu']
          NOT AVAILABLE
  
        /tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/system_info.py:1748: UserWarning:
            Lapack (http://www.netlib.org/lapack/) libraries not found.
            Directories to search for the libraries can be specified in the
            numpy/distutils/site.cfg file (section [lapack]) or by setting
            the LAPACK environment variable.
          return getattr(self, '_calc_info_{}'.format(name))()
        lapack_src_info:
          NOT AVAILABLE
  
        /tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/system_info.py:1748: UserWarning:
            Lapack (http://www.netlib.org/lapack/) sources not found.
            Directories to search for the sources can be specified in the
            numpy/distutils/site.cfg file (section [lapack_src]) or by setting
            the LAPACK_SRC environment variable.
          return getattr(self, '_calc_info_{}'.format(name))()
          NOT AVAILABLE
  
        numpy_linalg_lapack_lite:
          FOUND:
            language = c
            define_macros = [('HAVE_BLAS_ILP64', None), ('BLAS_SYMBOL_SUFFIX', '64_')]
  
        /tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'define_macros'
          warnings.warn(msg)
        running dist_info
        running build_src
        build_src
        building py_modules sources
        creating build
        creating build/src.linux-x86_64-3.10
        creating build/src.linux-x86_64-3.10/numpy
        creating build/src.linux-x86_64-3.10/numpy/distutils
        building library "npymath" sources
        Could not locate executable gfortran
        Could not locate executable f95
        Could not locate executable ifort
        Could not locate executable ifc
        Could not locate executable lf95
        Could not locate executable pgfortran
        Could not locate executable nvfortran
        Could not locate executable f90
        Could not locate executable f77
        Could not locate executable fort
        Could not locate executable efort
        Could not locate executable efc
        Could not locate executable g77
        Could not locate executable g95
        Could not locate executable pathf95
        Could not locate executable nagfor
        don't know how to compile Fortran code on platform 'posix'
        creating build/src.linux-x86_64-3.10/numpy/core
        creating build/src.linux-x86_64-3.10/numpy/core/src
        creating build/src.linux-x86_64-3.10/numpy/core/src/npymath
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npymath/npy_math_internal.h
          adding 'build/src.linux-x86_64-3.10/numpy/core/src/npymath' to include_dirs.
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npymath/ieee754.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npymath/npy_math_complex.c
        None - nothing done with h_files = ['build/src.linux-x86_64-3.10/numpy/core/src/npymath/npy_math_internal.h']
        building library "npysort" sources
        creating build/src.linux-x86_64-3.10/numpy/core/src/common
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/common/npy_sort.h
          adding 'build/src.linux-x86_64-3.10/numpy/core/src/common' to include_dirs.
        creating build/src.linux-x86_64-3.10/numpy/core/src/npysort
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/quicksort.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/mergesort.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/timsort.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/heapsort.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/radixsort.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/common/npy_partition.h
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/selection.c
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/common/npy_binsearch.h
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/npysort/binsearch.c
        None - nothing done with h_files = ['build/src.linux-x86_64-3.10/numpy/core/src/common/npy_sort.h', 'build/src.linux-x86_64-3.10/numpy/core/src/common/npy_partition.h', 'build/src.linux-x86_64-3.10/numpy/core/src/common/npy_binsearch.h']
        building library "npyrandom" sources
        building extension "numpy.core._multiarray_tests" sources
        creating build/src.linux-x86_64-3.10/numpy/core/src/multiarray
        conv_template:> build/src.linux-x86_64-3.10/numpy/core/src/multiarray/_multiarray_tests.c
        building extension "numpy.core._multiarray_umath" sources
        Traceback (most recent call last):
          File "/home/armstrong/DesmosBezierRenderer/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
            main()
          File "/home/armstrong/DesmosBezierRenderer/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/home/armstrong/DesmosBezierRenderer/env/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 157, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 248, in run_setup
            super(_BuildMetaLegacyBackend,
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 142, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 508, in <module>
            setup_package()
          File "setup.py", line 500, in setup_package
            setup(**metadata)
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/core.py", line 169, in setup
            return old_setup(**new_attr)
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 165, in setup
            return distutils.core.setup(**attrs)
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
            dist.run_commands()
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
            self.run_command(cmd)
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/command/dist_info.py", line 31, in run
            egg_info.run()
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/command/egg_info.py", line 24, in run
            self.run_command("build_src")
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
            self.distribution.run_command(command)
          File "/tmp/pip-build-env-4aafzkv5/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
            cmd_obj.run()
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/command/build_src.py", line 144, in run
            self.build_sources()
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/command/build_src.py", line 161, in build_sources
            self.build_extension_sources(ext)
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/command/build_src.py", line 318, in build_extension_sources
            sources = self.generate_sources(sources, ext)
          File "/tmp/pip-install-l3qpg98s/numpy_1345717379684ff5b8294f82b7b5aff5/numpy/distutils/command/build_src.py", line 378, in generate_sources
            source = func(extension, build_dir)
          File "numpy/core/setup.py", line 436, in generate_config_h
            moredefs, ignored = cocache.check_types(config_cmd, ext, build_dir)
          File "numpy/core/setup.py", line 47, in check_types
            out = check_types(*a, **kw)
          File "numpy/core/setup.py", line 292, in check_types
            raise SystemError(
        SystemError: Cannot compile 'Python.h'. Perhaps you need to install python-dev|python-devel.
        [end of output]
  
    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed
  
  × Encountered error while generating package metadata.
  ╰─> See above for output.
  
  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
`

I will provide any other information needed.
I am using Linux Mint.

backend error - even though the frames are labeled correctly it comes up with theses errors

[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame1.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame7.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame13.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame19.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame25.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame31.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame37.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame43.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame49.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame55.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame61.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame67.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame79.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame85.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame91.png'): can't open/read file: check file path/integrity
[ WARN:[email protected]] global loadsave.cpp:244 findDecoder imread_('frames/frame73.png'): can't open/read file: check file path/integrity
[ERROR] Unable to process one or more files. Remember image files should be named /frame. where INDEX represents the frame number starting from 1 and DIRECTORY and EXTENSION are defined by command line arguments (e.g. frames/frame1.png). Please check if:
The files exist
The files are all valid image files
The name of the files given is correct as per command line arguments
The program has the necessary permissions to read the file.

Use backend.py -h for further documentation


Full error traceback:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.10/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.10/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "/home/wsl/DesmosBezierRenderer/backend.py", line 120, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
File "/home/wsl/DesmosBezierRenderer/backend.py", line 94, in get_latex
path = get_trace(get_contours(filename))
File "/home/wsl/DesmosBezierRenderer/backend.py", line 64, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.7.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/wsl/DesmosBezierRenderer/backend.py", line 234, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/usr/lib/python3.10/multiprocessing/pool.py", line 367, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.10/multiprocessing/pool.py", line 774, in get
raise self._value
cv2.error: OpenCV(4.7.0) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

unable to clone

root@EPICPCTHING:/mnt/c/Windows/System32# git clone https://github.com/kevinjycui/DesmosBezierRenderer.git DesmosBezierRendererfatal: could not create work tree dir 'DesmosBezierRenderer': Permission denied

no clue what's going on, i copy+pasted the command from the guide, and i'm getting the same "Permission denied"

WSL linked can't be used

The WSL that is linked in the instructions doesn't have the button to download it from the Windows Store
image
image

Error

"""
Traceback (most recent call last):
File "/usr/lib/python3.8/multiprocessing/pool.py", line 125, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
return list(map(*args))
File "backend.py", line 87, in get_expressions
for expr in get_latex(FRAME_DIR + '/frame%d.%s' % (frame+1, FILE_EXT)):
File "backend.py", line 62, in get_latex
path = get_trace(get_contours(filename))
File "backend.py", line 36, in get_contours
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "backend.py", line 107, in
frame_latex = pool.map(get_expressions, frame_latex)
File "/usr/lib/python3.8/multiprocessing/pool.py", line 364, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
File "/usr/lib/python3.8/multiprocessing/pool.py", line 771, in get
raise self._value
cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

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.