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
Built Distribution
Close
Hashes for onnx-predict-yolov8-1.0.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f06b5c191e18f3091e9f0251436eb97f8250c67ad88c76f9c838792c1acf27 |
|
MD5 | a9042c6baec26d34e0ccceca4c835c8d |
|
BLAKE2b-256 | 4ecc0c88095ab89d7e2cd8f490045ae4ba021dbe54869612dc550c6916a96a36 |
Close
Hashes for onnx_predict_yolov8-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0de24a7f84fdd4cef6a79549ad87ad001f9a69962dd8553e89b31e393cc9c91 |
|
MD5 | 500ff88aecc7a0068e94e178780f46f8 |
|
BLAKE2b-256 | 3a224698f38bac087ad68c0a6feed9460d868c6c9ecf663dce85c16456b08eee |