Skip to content

Example of using YOLOv8 of Ultralytics in to Object Detection, Semantic Segmentation about image and video in PyQt

License

Notifications You must be signed in to change notification settings

yjg30737/pyqt-ultralytics-yolo-gui

Repository files navigation

pyqt-ultralytics-yolo-gui

Example of using YOLOv8 of Ultralytics in to Object Detection, Semantic Segmentation about image and video in PyQt

This is an example of how to easily use Ultralytics' YOLOv8 object detection and image segmentation models in PyQt.

A class called YOLOWrapper is created to download the model remotely before the PyQt software is run. After the software is run, the file path is received and object detection or image segmentation is performed according to the user's selection.

The supported files are as follows: png, jpg, mp4

After running this, result file would be saved in same directory of main.py. You will see how fast it is :)

This program has a simple customization option, so you can display or remove object boxes, object names, and the probability that an object belongs to a specific class.

What is YOLO?

YOLO is a model arcitecture that is gaining attention in the real-time object detection and image segmentation fields due to its fast speed. YOLOv8 is one of the most recent version of it.

Requirements

  • qtpy
  • PyQt6
  • PySide6
  • pillow
  • opencv-python
  • numpy
  • ultralytics
  • torchvision
  • lapx>=0.5.2
  • shapely>=2.0.0

How to Run

  1. git clone ~
  2. pip install -r requirements.txt
  3. python main.py
  4. Write path in the input and click run. There are a three files (2 images, 1 video) in sample folder in case of you don't want to be bothered by finding files to test.

Preview

image

Output

Object Detection over image

a_result

Semantic Segmentation over image

b_result

Semantic Segmentation over video: https://youtu.be/bdRfcM8MlXI

By default, it shows label and box, probability. I removed them by unchecking all options.

Releases

No releases published

Packages

No packages published

Languages