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

Increasing Video FPS running on CPU Using Threading #1411

Open
2 tasks done
dsaha21 opened this issue Jul 27, 2024 · 4 comments
Open
2 tasks done

Increasing Video FPS running on CPU Using Threading #1411

dsaha21 opened this issue Jul 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@dsaha21
Copy link
Contributor

dsaha21 commented Jul 27, 2024

Search before asking

  • 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?

  • Yes I'd like to help by submitting a PR!
@dsaha21 dsaha21 added the enhancement New feature or request label Jul 27, 2024
@yeldarby
Copy link
Contributor

Have you tried InferencePipeline from our other open source repo? It handles multithreading for video and can even handle processing multiple streams concurrently.

@dsaha21
Copy link
Contributor Author

dsaha21 commented Jul 28, 2024

Hi @yeldarby, Let me give it a try with the Inference Pipeline. If its successful, I will close the issue.

Thanks for the help 👍

@SkalskiP
Copy link
Collaborator

Hi @dsaha21, get_video_frames_generator was meant to be a very simple utility. I agree with @yeldarby. If you want a higher fps throughput InferencePipeline is for you. Also are you sure you got 0.17 fps? It seems super low.

@dsaha21
Copy link
Contributor Author

dsaha21 commented Jul 29, 2024

Hi @SkalskiP, Yes actually its very slow. I am trying by resizing the frames and InferencePipeline like mentioned above. Will let you if it runs with a good fps.

Thank you :)

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

No branches or pull requests

3 participants