supervision icon indicating copy to clipboard operation
supervision copied to clipboard

Increasing Video FPS running on CPU Using Threading

Open dsaha21 opened this issue 7 months ago • 13 comments

Search before asking

  • [X] I have searched the Supervision issues and found no similar feature requests.

Description

I want to increase FPS of a video running on my CPU system. I tested with few annotated and object tracking videos. When I am running the frames without passing through the model the fps is still low thus resulting lesser while passing them through YOLO or any model.

The code snippet I am using is

VideoSpeed1

So, with the following method and running the normal frames I am getting something like the following :

VideoSpeed2

With normal supervision's frame generator - fps is around 1-10 max With threading its increasing to a greater value

Use case

If we notice there is a significant change with threading. I was wondering if we could add a MainThread Class in the supervision utils in sv.VideoInfo or add a total new class so that frames running on CPU can have such fps. Let me know if we can handle such case. I can share the python file on drive if necesssary.

Thanks

Additional

No response

Are you willing to submit a PR?

  • [X] Yes I'd like to help by submitting a PR!

dsaha21 avatar Jul 27 '24 21:07 dsaha21