Metadata-Version: 2.1
Name: onnx-predict-yolov8
Version: 1.0.5
Author-email: Kasper Fromm Pedersen <kasperf@cs.aau.dk>, Kristian Torp <torp@cs.aau.dk>
Maintainer-email: Kasper Fromm Pedersen <kasperf@cs.aau.dk>
License: MIT License
        
        Copyright (c) 2023 Aalborg University
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: homepage, https://www.cs.aau.dk/
Project-URL: repository, https://github.com/fromm1990/onnx-predict-yolov8
Keywords: ONNX,YOLOv8,onnxruntime,vision
Requires-Python: <3.12,>=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# 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
```python
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))
```
