-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Example] Three threads inference in Yolov8 with Opencv DNN C++ loading Onnx, and Python. C++ in window10, Linux #10201
Open
ZouJiu1
wants to merge
15
commits into
ultralytics:main
Choose a base branch
from
ZouJiu1:threads_video
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10201 +/- ##
==========================================
- Coverage 74.77% 70.60% -4.18%
==========================================
Files 122 122
Lines 15634 15634
==========================================
- Hits 11690 11038 -652
- Misses 3944 4596 +652
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have checked for Existing Contributions: Before submitting, my contribution is unique and complementary.
No related issues.
directory: examples\YOLOv8-Threads-Cpp-Python-Video
Three threads inference in Yolov8 with Opencv DNN C++ loading Onnx, and Python.
C++ and Python, it all have three threads to cowork. each of them works independently. Like customer and producer.
the first thread reads video frame;
the second thread predict the frame;
the third thread plot the prediction result to the frame and save it to video;
Reading video thread is a producer, predicting the frame thread is a customer. Then predicting the frame thread will give a prediction result, now it is a producer, ploting and saving thread is a customer. To write these function, we need a queue which is safe between different threads. Python have a Queue which is thread-safe in queue package. C++ doesn't provide such thread-safe queue, so I write a thread-safe queue by myself.
I have read the CLA Document and I sign the CLA
I also have read the examples/README.md
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Introducing multi-threaded video processing for YOLOv8 in both C++ and Python.
📊 Key Changes
🎯 Purpose & Impact
Overall, this update is set to markedly improve the speed and efficiency of video processing tasks using YOLOv8, making it more accessible across different platforms and even to those with limited multi-threading experience.