Skip to content

zhouzq-thu/YOLOv8_ONNX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YOLOv8_ONNX

Use the YOLOv8 model in ONNX to perform the following tasks:

  • object detection
  • instance segmentation
  • pose estimation

The above results are from YOLOv8n.

Examples

  1. Convert model to ONNX
python export.py
  1. Inference
import cv2
from YOLOv8_ONNX import YOLOv8, YOLOv8Seg, YOLOv8Pose

yolo = YOLOv8("models/yolov8n.onnx", conf_thres=0.3, iou_thres=0.5)
# yolo = YOLOv8Seg("models/yolov8n-seg.onnx", conf_thres=0.3, iou_thres=0.5)
# yolo = YOLOv8Pose("models/yolov8n-pose.onnx", conf_thres=0.3, iou_thres=0.5)

img = cv2.imread("assets/bus.jpg", cv2.IMREAD_COLOR)

# Detect Objects
yolo(img)

# Draw detections
combined_img = yolo.draw_results(img)
cv2.namedWindow("Output", cv2.WINDOW_NORMAL)
cv2.imshow("Output", combined_img)
cv2.waitKey(0)
  1. Quantization
python quant.py
  1. Benchmark
python perf.py

References:

About

YOLOv8 model in ONNX

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages