ONNX-YOLOv8-Object-Detection Project Overview
The ONNX-YOLOv8-Object-Detection project aims to facilitate object detection using the YOLOv8 model in an Onnx runtime environment. This project helps users implement efficient object detection in Python, leveraging models designed for rapid and accurate analysis of images and video streams. Below is a comprehensive guide to understanding and utilizing this project.
Key Features and Usage
Image Processing
- The project allows users to process images directly by resizing them to fit the model's input size. It's important to note that the aspect ratio of the input must be close to that of the intended usage images to maintain accuracy.
Hardware Requirements
- Users should refer to the
requirements.txt
for pre-requisites. - For those with NVIDIA GPUs, it suggests using the
onnxruntime-gpu
for optimized performance. Otherwise, the standardonnxruntime
library suffices.
Installation
To get started with the ONNX-YOLOv8-Object-Detection, the following steps are necessary:
git clone https://github.com/ibaiGorordo/ONNX-YOLOv8-Object-Detection.git
cd ONNX-YOLOv8-Object-Detection
pip install -r requirements.txt
For systems with Nvidia GPUs:
pip install onnxruntime-gpu
For other systems:
pip install onnxruntime
Model Conversion
To utilize the YOLOv8 model in an ONNX format, users can convert the model via Google Colab:
- A detailed notebook is provided: Open In Colab.
For conversion with ultralitics:
from ultralytics import YOLO
model = YOLO("yolov8m.pt")
model.export(format="onnx", imgsz=[480,640])
Running Object Detection
The project supports various inference methods:
-
Image Inference: Run object detection on images.
python image_object_detection.py
-
Webcam Inference: Detect objects using a live webcam feed.
python webcam_object_detection.py
-
Video Inference: Perform object detection on video files.
python video_object_detection.py
Original and Reference Models
The original YOLOv8 model can be accessed here: YOLOv8 Repository. It is licensed under GPL-3.0, which allows for modification and distribution under certain terms (License).
Additionally, users can explore models like YOLOv5 to YOLOv7 and find further resources in PINTO0309's model zoo.
This ONNX-YOLOv8-Object-Detection project provides comprehensive tools and references for anyone looking to implement high-performance object detection efficiently, ensuring ease-of-use for both beginners and seasoned developers in the field of computer vision.