Skip to main content

You Only Look ONNX

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

Example Detector Usage

from pathlib import Path

from onnxruntime import InferenceSession
from PIL import Image

from yolonnx.services import Detector
from yolonnx.to_tensor_strategies import PillowToTensorContainStrategy

model = Path("path/to/file.onnx")
session = InferenceSession(
    model.as_posix(),
    providers=[
        "CUDAExecutionProvider",
        "CPUExecutionProvider",
    ],
)

predictor = Detector(session, PillowToTensorContainStrategy())
img = Image.open("path/to/image.jpg")
print(predictor.run(img))

Example Classifier Usage

from pathlib import Path

from onnxruntime import InferenceSession
from PIL import Image

from yolonnx.services import Classifier
from yolonnx.to_tensor_strategies import PillowToTensorContainStrategy

model = Path("path/to/file.onnx")
session = InferenceSession(
    model.as_posix(),
    providers=[
        "CUDAExecutionProvider",
        "CPUExecutionProvider",
    ],
)

predictor = Classifier(session, PillowToTensorContainStrategy())
img = Image.open("path/to/image.jpg")
print(predictor.run(img))

Metadata

Release files for yolonnx 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yolonnx 0.5.0
File Size Uploaded
yolonnx-0.5.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yolonnx 0.5.0
File Interpreter ABI Platform
yolonnx-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / yolonnx-0.5.0.tar.gz

Download URL yolonnx-0.5.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
662eeabe644adcfba7a988b8babdd73e4ac6a173a51d11ae0cf3122f63bf8235
BLAKE2b-256 checksum
How to use checksums
4d174eef703a170e65d317f8d06a8f7ecf35edc069b6d766fac448bc5305af08
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / yolonnx-0.5.0-py3-none-any.whl

Download URL yolonnx-0.5.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ecd9af1bc6015500bfcb6112bdbcaaf3929371ca20458e6cc1da4435ee922d35
BLAKE2b-256 checksum
How to use checksums
a98afe8fb77269f079275cb43a2b33432f2c6341f0eeb405750bd68169772393
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page