Skip to main content

Different ways of visualizing objects given bounding box data

Project description

bbox-visualizer

Documentation Status Test License: MIT Ruff PyPI version Downloads

This package helps users draw bounding boxes around objects, without doing the clumsy math that you'd need to do for positioning the labels. It also has a few different types of visualizations you can use for labeling objects after identifying them.

The bounding box points are expected in the format: (xmin, ymin, xmax, ymax)

Installation:

pip install bbox-visualizer

Usage:

import bbox_visualizer as bbv

cover

Photos by Joshua Earle, Jonas Weckschmied and Sherzod Max on Unsplash.

image function
bbox with label on top img = bbv.draw_rectangle(img, bbox)
img = bbv.add_label(img, label, bbox, top=True)
bbox with T label img = bbv.draw_rectangle(img, bbox)
img = bbv.add_T_label(img, label, bbox)
label with flag img = bbv.draw_flag_with_label(img, label, bbox)
bbox with label inside img = bbv.draw_rectangle(img, bbox)
img = bbv.add_label(img, label, bbox, top=False)
label with opaque overlay img = bbv.draw_rectangle(image, bbox, is_opaque=True)
img = bbv.add_label(img, label, bbox, draw_bg=False, top=False)
multiple bbox img = bbv.draw_multiple_rectangles(img, bboxes)
img = bbv.add_multiple_labels(img, labels, bboxes)
multiple flags img = bbv.draw_multiple_flags_with_labels(img, labels, bboxes)
multiple T bbox img = bbv.draw_multiple_rectangles(img, bboxes)
img = bbv.add_multiple_T_labels(img, labels, bboxes)

There are optional functions that can draw multiple bounding boxes and/or write multiple labels on the same image, but it is advisable to use the above functions in a loop in order to have full control over your visualizations.

  • bbv.draw_multiple_rectangles(img, bboxes)
  • bbv.add_multiple_labels(img, labels, bboxes)
  • bbv.add_multiple_T_labels(img, labels, bboxes)
  • bbv.draw_multiple_flags_with_labels(img, labels, bboxes)

bboxes and labels are lists in the above examples.

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

bbox_visualizer-0.2.2.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

bbox_visualizer-0.2.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file bbox_visualizer-0.2.2.tar.gz.

File metadata

  • Download URL: bbox_visualizer-0.2.2.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for bbox_visualizer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 864a8d7ed6fa9aac0284bf584ce3964cdd6da5a2f83b73ee8b27480869fc774f
MD5 bfb36b7252542850915504996cd3063b
BLAKE2b-256 4f99ff86ac54483b72a6d8acfc5435858a0ab927167c5582c0f19f529097e3ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for bbox_visualizer-0.2.2.tar.gz:

Publisher: publish.yml on shoumikchow/bbox-visualizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bbox_visualizer-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bbox_visualizer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 61c2be8ce540d8ed0cff016ba9c0c662b25c8657a86f20736f44f23e152ad65d
MD5 478d1b411080847b451cfa6bb5608fd0
BLAKE2b-256 d60b0d37b93893d1fa959d059c7f5af8527bfc9a34887678ebec48045ece2d1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bbox_visualizer-0.2.2-py3-none-any.whl:

Publisher: publish.yml on shoumikchow/bbox-visualizer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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