Skip to content

JS-Coder007/YOLOv8-Object-Detection

Repository files navigation

DESCRIPTION:

|YOLOv8 Object Detection Example Original image source: Flickr - Nicole Lee

⚠️ Important Note

  • 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.

📦 Requirements for the Program

  • Refer to the requirements.txt file for dependencies.
  • If you're using a NVIDIA GPU, install onnxruntime-gpu. Otherwise, install the standard onnxruntime.

🛠️ Installation

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

ONNX Runtime Setup

  • For systems with NVIDIA GPU:

    pip install onnxruntime-gpu
  • For CPU-only systems(without Discrete GPU):

    pip install onnxruntime

🔄 Convert YOLOv8 to ONNX(Open Neural Network Exchange)

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

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 the models directory. Make sure to update your script with the correct filename if needed.


📁 Original YOLOv8 Repository


🚀 Example Usage:

🔹 Image Inference Used

python image_object_detection.py

🔹 Webcam Inference

python webcam_object_detection.py

🔗 References


About

Object-Detection-using-Open Neural Network Exchange YOLOv8

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages