ibaiGorordo / ONNX-YOLOv8-Object-Detection

Python scripts performing object detection using the YOLOv8 model in ONNX.
MIT License
369 stars 93 forks source link
computer-vision deep-learning object-detection onnx onnxruntime opencv python yolo yolov8

! ONNX YOLOv8 Object Detection Original image: https://www.flickr.com/photos/nicolelee/19041780

Important

Requirements

Installation

git clone https://github.com/ibaiGorordo/ONNX-YOLOv8-Object-Detection.git
cd ONNX-YOLOv8-Object-Detection
pip install -r requirements.txt

ONNX Runtime

For Nvidia GPU computers: pip install onnxruntime-gpu

Otherwise: pip install onnxruntime

ONNX model

Use the Google Colab notebook to convert the model: Open In Colab

You can convert the model using the following code after installing ultralitics (pip install ultralytics):

from ultralytics import YOLO

model = YOLO("yolov8m.pt") 
model.export(format="onnx", imgsz=[480,640])

Original YOLOv8 model

The original YOLOv8 model can be found in this repository: YOLOv8 Repository

Examples

References: