bbox-visualizer

Different ways of visualizing objects given bounding box data


Keywords
bbox_visualizer, computer-vision, cv, python3, object-detection, labeling, object-recognition, computer-vision-tools, data-labeling, bboxes
License
MIT
Install
pip install bbox-visualizer==0.1.0

Documentation

bbox-visualizer

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)

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 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.

Credits

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