Skip to main content

Draws boxes on images from annotations in YOLO format

Project description

testing badge coverage badge docs badge black badge

Draws boxes on images from annotations in YOLO format.

Installation

Install using pip:

pip install drawyolo

Or directly from the repository:

pip install git+https://github.com/rbturnbull/drawyolo.git

Drawing boxes from labels

If you have a label file in YOLO format like this:

class_id x_center y_center width height

For example:

0 0.35 0.35 0.14 0.14
0 0.55 0.3 0.14 0.14
1 0.7 0.15 0.2 0.2

Then you can draw the boxes on an image like this:

drawyolo image.jpg output.jpg --labels labels.txt --classes class1,class2

To try it out on the image in the repository:

drawyolo tests/test-data/terrier.webp tests/test-data/output.jpg --labels tests/test-data/labels.txt --classes eye,ear

That will create an image like this:

Output image

Drawing boxes from a YOLO model

If you have a YOLO model with weights, you can draw the boxes on an image like this:

drawyolo image.jpg output.jpg --weights model.pt

Advanced usage

For more options see the help

drawyolo --help

Credits

Robert Turnbull (Melbourne Data Analytics Platform) - https://robturnbull.com

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

drawyolo-0.1.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

drawyolo-0.1.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file drawyolo-0.1.0.tar.gz.

File metadata

  • Download URL: drawyolo-0.1.0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for drawyolo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e53e36f8a758afa3b84df7d224d1aaf241cd97e59bd465de0ab577550d55926c
MD5 ca0c15add3efb339da4af17fa7d5df5a
BLAKE2b-256 2a28d71207ce481c5df62b50a11bf74529307daf38cd3961b4f1cc897001f308

See more details on using hashes here.

File details

Details for the file drawyolo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: drawyolo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.1 Darwin/24.2.0

File hashes

Hashes for drawyolo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa94b5c91a9ac58752bece74fc3d43f5208a037b67c2ecc22c739fda172f0496
MD5 9d6944521bcd5d993313ddc57b924ee7
BLAKE2b-256 ba7aceb9bacf39bf85e62c4ae946d0b2e64871266f66ed5dd327e32b6749145e

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