Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Triangulation slower with jit decorator #19

Open
paul-wispr opened this issue Mar 17, 2023 · 3 comments
Open

Triangulation slower with jit decorator #19

paul-wispr opened this issue Mar 17, 2023 · 3 comments

Comments

@paul-wispr
Copy link

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
Copy link

Billccx commented Oct 8, 2023

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

@paul-wispr
Copy link
Author

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!)

@philipqueen
Copy link
Contributor

I've done some exploration of this in the Freemocap fork of Aniposelib: freemocap/freemocap#642

What I've found so far is that the fastest option is simply to turn off the parallel flag (set parallel=False). This option is roughly 32 times faster in a benchmark, and 134 times faster when running from Freemocap (I have no clue why the speedup is 4x faster when run in context).

There's also a new fast=True option in the triangulate function, which claims a 20x speedup at the cost of handling outlier data differently. I haven't tried that option yet, but it would be interesting to compare its speed compared to the different jit options I've tested.

@lambdaloop this may be interesting to you as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants