/PyQt5-Yolov8-Gui

This project makes it easier to make detections using onnx models and cuda's speed.

Primary LanguagePythonMIT LicenseMIT

PyQt5-Yolov8-Onnx-Gui

yolov8nonnx yolov8monnx yolov8lonnx yolov8xonnx

This repo is specially prepared for users who want to run onnx models. The program still has shortcomings and these can be improved. However, if you want to contribute to development, I wouldn't say no. I would be pleased.

The aim of this project is to enable CUDA-based operation of onnx models in an interface and human detection. The detections made can be monitored instantly in the interface created with PyQt5.

You can select 4 onnx models via the interface, then add and run your rtsp camera or local webcam via the code.

Additionally, this interface provides the opportunity to detect objects in live streaming and use onnx models.

You can upload your own onnx models here and change the code.

Since it is difficult to find such properly working interfaces in the market, I am sharing my own project with you. Of course, the project has shortcomings and these will be improved in the future. If you would like to contribute please feel free to do so.

Since it is a program that I am currently distributing, it works and works. I will write down all the changes you need to make in the code. This will save you from a huge burden.

Installation

To run this project, you must first have Python and pip installed on your computer. To download this project, you can use the `git clone` command as follows:

https://github.com/berkakyildizz/PyQt5-Yolov8-Gui.git

After downloading the project files and installing the required libraries, you can start the GUI by running the following command

conda install pytorch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 pytorch-cuda=11.8 -c pytorch -c nvidia
# After 
pip install -r requirements.txt
pip install onnx
pip install onnxruntime-gpu

If CUDA is not installed on your computer, it will run on CPU models and you can see it as CPUExecutionProvider in the interface. However, if you install CUDA and cudnn, you can run it via CUDAExecutionProvider. My suggestion is to use CUDA. I am using CUDA 11.8, cudnn 8.9.2 versions. You can download and install them from the NVIDIA official website.

Run

First, if you have a database and want to record the findings, you will need to make a few changes. If you do not have a database connection, you can run and use the code by canceling the DatabaseManager part.
server = 'server_ip'
database = 'database_name'
username = 'username'
password = 'password'

You must fill these values ​​with your own database values ​​in the DatabaseManager class in the code block. After that,

You have to add own rtsp adresses in Choose Camera Line. For example: 'rtsp://admin:admin1admin1@192.168.1.108:554/cam/realmonitor?channel=1&subtype=1'

Then you need to give your own url path to camera_url in the start_camera function in the MainWindow class.

Choose Camera = 'enter_rtsp_addresses'

The changes you will make to adapt it to yourself are over.

After downloading the project files and installing the required libraries, you can start the GUI by running the following command:

python main.py

Deploy

To convert the program to an exe file you must:

First, install pyinstaller by running the following command:

pip install pyinstaller

After installing pyinstaller, enter the terminal and run:

pyinstaller main.spec

Use

After determining the iou, conf and model in this program, you can start the IP camera you wrote and perform detection operations using the onnx models. I decided to publish such a repo due to the optimization difficulties of Onnx models and the fact that they are slightly different from models with .pt extension. If you like it, please don't forget to star!