ultralytics / yolov5

YOLOv5 πŸš€ in PyTorch > ONNX > CoreML > TFLite

Home Page:https://docs.ultralytics.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

YOLOv5 GUI Implementation

haseebakbar94 opened this issue Β· comments

Search before asking

Question

i want to implement a GUI using YOLOv5 in which there are multiple live feeds from camera now i want that each feed is detected by their own model and their result is showed in a cascaded window in GUI. i have tried implementing it using script but from there i cant access the results without saving them. I have tried implementing the run function of detect.py within the gui but it still shows lag and too much delay as I am accessing the video streams using cv2 and giving model a single frame like frame by frame. Please suggest me a solution.

Additional

No response

πŸ‘‹ Hello @haseebakbar94, thank you for your interest in YOLOv5 πŸš€! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a πŸ› Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Requirements

Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

YOLOv5 CI

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Introducing YOLOv8 πŸš€

We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 πŸš€!

Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.

Check out our YOLOv8 Docs for details and get started with:

pip install ultralytics

@haseebakbar94 hello! It sounds like you're working on an interesting project with YOLOv5 for real-time object detection across multiple live feeds. Implementing a GUI that integrates with YOLOv5, especially with multiple models running concurrently, can indeed be challenging and may introduce latency depending on how it's set up.

For your specific case, optimizing performance when processing frame by frame from live feeds involves a few considerations:

  1. Model Optimization: Ensure you're using the most suitable YOLOv5 model variant for your needs. Smaller models (e.g., YOLOv5s) offer faster inference times at the cost of some accuracy, which might be a worthwhile trade-off for real-time applications.
  2. Batch Processing: If possible, batch process frames before sending them to the model. This can reduce overhead and improve overall throughput, though it might not be entirely feasible with real-time constraints.
  3. Parallel Processing: Consider running each model in its own thread or process to take full advantage of multi-core CPUs. This approach can help mitigate the lag you're experiencing by ensuring that the processing of one feed doesn't block the others.
  4. Hardware Acceleration: Utilize GPU acceleration if available. Ensure your setup is correctly leveraging CUDA for NVIDIA GPUs to significantly speed up inference times.

Remember, any usage of Ultralytics models, architectures, or code in your project, at any stage in R&D, development, and deployment, requires adherence to our licensing terms. If your project is not fully open-sourced under the AGPL-3.0 license, you will need an Ultralytics Enterprise License. This applies to internal company usage as well, unless the company is open-sourcing their work under AGPL-3.0.

For more detailed guidance on optimization and licensing, please refer to our documentation at https://docs.ultralytics.com/yolov5/.

Best of luck with your project, and thank you for being part of the YOLO community! πŸš€