Closed epigraphe closed 10 months ago
@epigraphe hello,
It seems you are working on a project where you wish to process multiple video streams separately in a Django application using YOLOv8. You've noticed that the streams are being output sequentially and are looking for a way to distinguish between different streams for parallel processing.
From your description, it appears that you are trying to process streams in a loop and are looking for a unique identifier or index that can separate frames from different streams. In typical YOLOv8 usage, if you're processing multiple streams, each stream will have associated metadata that can be used as an index or identifier.
You mentioned seeing output such as 0: 384x640 (no detections), 1: 384x640 (no detections), 2: 384x640 1 person, 6.3ms
. This indicates that the model is indeed processing multiple streams and is providing a stream index before each frame's details. This index is the key to separating your results.
When you process each frame, you should carry this index forward and use it within your generate_frames
function to create separate frames for each stream index. Ensure that when you call model(image)
within your loop, you are also keeping track of this index so that each yielded frame is tagged with the correct stream identifier.
Inside the generate_frames
function, you would then have a way to match the frame being processed to the specific stream it belongs to. This identifier will be crucial when incorporating the frames back into your Django application, especially if your goal is to display each stream in a separate thread or a distinct page section.
Make sure that for each frame processed, the identifier is passed along so that any further processing or display logic can reference this identifier to keep your streams separate.
I hope this explanation helps guide you to a solution for processing your multiple video streams within your Django application. If you need more detailed guidance regarding the best practices for implementation, I encourage you to explore the Ultralytics documentation, as it may provide further insights into handling streams and processing results with YOLOv8.
Happy coding, and I wish you success with your implementation!
Thank you for your help
@epigraphe you're welcome! If you have any more questions or need further assistance in the future, feel free to ask. Good luck with your project using YOLOv8, and I hope it turns out great!
Happy detecting! šš
Search before asking
Question
After detections and annotations, Iām trying to display three threads separately in Django. As a result, it turns out that all streams are output in one place, one after another, the frame from the first changes to the second, third, etc. How to separate them? Is there any index I can use as a guide? I tried
and didn't find anything similar to thread index.
This is also displayed - and the thread index is there.
0: 384x640 (no detections), 1: 384x640 (no detections), 2: 384x640 1 person, 6.3ms
How can I use it in my code? Thank you
Additional
No response