Skip to main content

Different ways of visualizing objects given bounding box data

Project description


This is a simple library which has different functions that lets users draw different types of visualizations. Useful for visualizing objects after object detection.

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


pip install bbox-visualizer


import bbox_visualizer as bbv


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

image function
bbox with label on top bbv.draw_rectangle(img, bbox)
bbv.add_label(img, label, bbox, top=True)
bbox with T label bbv.draw_rectangle(img, bbox)
bbv.add_T_label(img, label, bbox)
label with flag bbv.draw_flag_with_label(img, label, bbox)
bbox with label inside bbv.draw_rectangle(img, bbox)
bbv.add_label(img, label, bbox, top=False)
label with opaque overlay bbv.draw_rectangle(image, bbox, is_opaque=True)
bbv.add_label(img, label, bbox, draw_bg=False, top=False)
multiple bbox bbv.draw_multiple_rectangles(img, bboxes)
bbv.add_multiple_labels(img, labels, bboxes)
multiple flags bbv.draw_multiple_flags_with_labels(img, labels, bboxes)
multiple T bbox bbv.draw_multiple_rectangles(img, bboxes)
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.


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.

Files for bbox-visualizer, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size bbox_visualizer-0.1.0-py2.py3-none-any.whl (6.2 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page