🤗 Citation
This code was forked from yolov9pip.
Description
This code is lightly updated to allow use of Pytorch >2.6 as an imported library.
This repo is a packaged version of the Yolov9 model.
⭐ Installation
pip install yolov9pip
🌠 Yolov9 Inference
import yolov9
# load pretrained or custom model
model = yolov9.load(
"yolov9-c.pt",
device="cpu",
)
# set model parameters
model.conf = 0.25 # NMS confidence threshold
model.iou = 0.45 # NMS IoU threshold
model.classes = None # (optional list) filter by class
# set image
imgs = "data/zidane.jpg"
# perform inference
results = model(imgs)
# inference with larger input size and test time augmentation
results = model(img, size=640)
# parse results
predictions = results.pred[0]
boxes = predictions[:, :4] # x1, y1, x2, y2
scores = predictions[:, 4]
categories = predictions[:, 5]
# show detection bounding boxes on image
results.show()
😍 Contributing
pip install -r dev-requirements.txt
pre-commit install
pre-commit run --all-files
Metadata
Release files for yolov9-trunk 0.0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| yolov9_trunk-0.0.2.3.tar.gz | 231.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| yolov9_trunk-0.0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 516.6 kB
Release files / yolov9_trunk-0.0.2.3.tar.gz
| Download URL | yolov9_trunk-0.0.2.3.tar.gz |
|---|---|
| Size | 231.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fba1111e12292f3682f1d5182a98f25da72ba5ab7d37ed0fa69f7bf9362c581
|
|
BLAKE2b-256 checksum How to use checksums |
1484750bb79f323a10c08cec7dd6a2d41a2c394252a5947e176aa4ad864a6efc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / yolov9_trunk-0.0.2.3-py3-none-any.whl
| Download URL | yolov9_trunk-0.0.2.3-py3-none-any.whl |
|---|---|
| Size | 285.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c8827b3b02aa02b6f37c2789464170b684e5585ea4a08a9898ed68d4dce56ab5
|
|
BLAKE2b-256 checksum How to use checksums |
b7e8c9ecc8b2f7dbfcdb145ca8bb784d9705a13129985f3aa229601a98133ec9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|