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_box(img, bbox)
img = bbv.add_label(img, label, bbox, top=True)
bbox with T label img = bbv.draw_box(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_box(img, bbox)
img = bbv.add_label(img, label, bbox, top=False)
label with opaque overlay img = bbv.draw_box(image, bbox, is_opaque=True)
img = bbv.add_label(img, label, bbox, draw_bg=False, top=False)
multiple bbox img = bbv.draw_multiple_boxes(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_boxes(img, bboxes)
img = bbv.add_multiple_T_labels(img, labels, bboxes)

Note: The functions draw_rectangle and draw_multiple_rectangles are also available as aliases for draw_box and draw_multiple_boxes respectively. Both naming conventions work identically.

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_boxes(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.3.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

bbox_visualizer-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for bbox_visualizer-0.3.0.tar.gz
Algorithm Hash digest
SHA256 dc124756ac37bd3a87960437d4f21123ba1015c2d845e2ef8d59812946a2f95c
MD5 c8ca18e700ea09d87db191034565eee2
BLAKE2b-256 71559f2b0ff08b476998ca905e6a14da9e9b8d149e2bd3caf6f95542f86ccaee

See more details on using hashes here.

Provenance

The following attestation bundles were made for bbox_visualizer-0.3.0.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.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bbox_visualizer-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 da8a035c3b082ac453132d69c1531d348b078082505ba4426f48d1e15808f9d5
MD5 a49e55ccf9be511e1298b531d5107893
BLAKE2b-256 c56a47e50f1f36f6c208574624369c4c9453ca15dcd3e85d026c53d6bd880b11

See more details on using hashes here.

Provenance

The following attestation bundles were made for bbox_visualizer-0.3.0-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 Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page