Skip to main content

yolov9-trunk

Project description

🤗 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

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

yolov9_trunk-0.0.2.2.tar.gz (228.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yolov9_trunk-0.0.2.2-py3-none-any.whl (282.5 kB view details)

Uploaded Python 3

File details

Details for the file yolov9_trunk-0.0.2.2.tar.gz.

File metadata

  • Download URL: yolov9_trunk-0.0.2.2.tar.gz
  • Upload date:
  • Size: 228.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for yolov9_trunk-0.0.2.2.tar.gz
Algorithm Hash digest
SHA256 3952235508ecc164d8ca799a3ca614886368136ddb65ec16d024fac057201d80
MD5 451ee003a66557538d8583672e2d3777
BLAKE2b-256 9ea6f859c60389d13b36e0434a2883541841a3d3a04c4c526c0281af5e0d0c2a

See more details on using hashes here.

File details

Details for the file yolov9_trunk-0.0.2.2-py3-none-any.whl.

File metadata

  • Download URL: yolov9_trunk-0.0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 282.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for yolov9_trunk-0.0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 053ded6165e984efe7cbf892d73c3aedb5572debb04c56db933944f761c5e03d
MD5 c9fd74b27e11f3babe3102e54a905402
BLAKE2b-256 441632d24688a11d5aca0df89fa76a3c1cdfa64f39b3c9309dc611b69cc9227c

See more details on using hashes here.

Supported by

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