|
Original image source: Flickr - Nicole Lee
- Input images are resized directly to fit the model’s expected input dimensions.
- Padding is not applied, which may reduce accuracy if your images have a different aspect ratio than the model’s input size.
- To maintain performance, try to use input sizes that closely match the aspect ratio of your images and try to reduce the size of the Image if possible.
- Refer to the
requirements.txt
file for dependencies. - If you're using a NVIDIA GPU, install
onnxruntime-gpu
. Otherwise, install the standardonnxruntime
.
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 GPU:
pip install onnxruntime-gpu
-
For CPU-only systems(without Discrete GPU):
pip install onnxruntime
Use the Google Colab notebook to export the model:
Alternatively, convert using Python with Ultralytics:
from ultralytics import YOLO
model = YOLO("yolov8m.pt")
model.export(format="onnx", imgsz=[480, 640])
💡 The original YOLOv8 models were converted to ONNX and other formats by PINTO0309. You can download them from his model zoo repository. Either run the
download_single_batch.sh
script or manually download and place the ONNX files (e.g.,yolov8m_480x640.onnx
) into themodels
directory. Make sure to update your script with the correct filename if needed.
- Source: ultralytics/ultralytics
- License: GPL-3.0 License
python image_object_detection.py
python webcam_object_detection.py