Skip to main content

No project description provided

Project description

ONNX-PREDICT-YOLOV8

This repository is a light weight library to ease the use of ONNX models exported by the Ultralytics YOLOv8 framework.

Example Usage

from onnxruntime import InferenceSession
from PIL import Image
from opyv8 import Predictor

model = Path("path/to/file.onnx")
# List of classes where the index match the class id in the ONNX network
classes = model.parent.joinpath("classes.names").read_text().split("\n")
session = InferenceSession(
    model.as_posix(),
    providers=[
        "CUDAExecutionProvider",
        "CPUExecutionProvider",
    ],
)
predictor = Predictor(session, classes)
img = Image.open("path/to/image.jpg")
print(predictor.predict(img))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onnx-predict-yolov8-1.0.6.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

onnx_predict_yolov8-1.0.6-py3-none-any.whl (6.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page