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

Is there a best example of multithreading or WebApi? #30

Closed
threerog opened this issue Dec 24, 2023 · 1 comment
Closed

Is there a best example of multithreading or WebApi? #30

threerog opened this issue Dec 24, 2023 · 1 comment

Comments

@threerog
Copy link

Is YoloV8 object thread safe?
As is well known, it is very time-consuming to load the model for the first time. How to efficiently use YoloV8 when making concurrent calls in the form of multithreading or WebApi?
Can you provide some relevant examples or solutions?
For example, is it feasible to use lock or singleton patterns

@dme-compunet
Copy link
Owner

The internal logic of YoloV8 should be thread safe, however GPUs sometimes cannot perform inference in parallel, for this there is the property YoloV8parameters.SuppressParallelInference which when it is set to true the inference is performed inside a lock block, the preprocess and postprocess will still work in parallel to speed up the results.

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

2 participants