lambdaloop / aniposelib

📷 🐊 An easy-to-use library for calibrating cameras in python
https://anipose.readthedocs.io
BSD 2-Clause "Simplified" License
71 stars 33 forks source link

Triangulation slower with jit decorator #19

Open paul-wispr opened 1 year ago

paul-wispr commented 1 year ago

I noticed that commenting out the "jit" decorator that applies to the "triangulate_simple" function (decorator on line 20, function definition on line 21 of cameras.py) substantially improves the runtime of the code. For 12 tracked features in a 5 minute video sampled at 100Hz, the runtime was ~6 minutes with the code as is and only ~10s with the decorator commented out.

It might be worth your exploring whether my experience is generalizable, in which case maybe it's better to skip the jit decorators or at least make it clear in what cases the decorator helps vs. hurts!

Billccx commented 12 months ago

Hello! I have the same question. Have you got the answer?

paul-wispr commented 12 months ago

My fix was just to fork the repo and import the forked version rather than the main repo (i.e. I just removed the decorator!)