handtracking icon indicating copy to clipboard operation
handtracking copied to clipboard

Threading to "improve" visual performance

Open alyata opened this issue 5 years ago • 2 comments

Hi, @victordibia Thanks for your work! I've been experimenting with tensorflow object detection models (yours included) and I came by a trick to make the FPS higher. I ran the model inference on a separate thread, but I don't feed every frame into the model. While the child thread is still processing the previous frame, I simply skip model inference and re-use previous bounding box results. I understand that this isn't an actual improvement in model performance, but it helped me render the camera feed in 34 FPS while the actual model was running at 11 FPS. Is there any way I can adapt my code to this project? It's my first time contributing.

alyata avatar Jul 12 '19 07:07 alyata

HI @kapzlok2408 , This sounds like an interesting addition - there might be users who dont mind the skipped frames. Perhaps you can send a PR which updates the detect_multi-thread.py and adds an argument flag "reusing previous frames". When the flag is set, your fps hack "is implemented"?

 python detect_multi_threaded.py --reuseframes  0 --source videos/chess.mov

Let me know what you think, and thanks for sharing.

Victor.

victordibia avatar Jul 12 '19 10:07 victordibia

Sounds good, I'll try to make the changes.

alyata avatar Jul 15 '19 02:07 alyata