New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bbox-visualizer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bbox-visualizer

Different ways of visualizing objects given bounding box data

  • 0.2.0
  • PyPI
  • Socket score

Maintainers
1

bbox-visualizer

Documentation Status License: MIT 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.
imagefunction
bbox with label on topimg = bbv.draw_rectangle(img, bbox)
img = bbv.add_label(img, label, bbox, top=True)
bbox with T labelimg = bbv.draw_rectangle(img, bbox)
img = bbv.add_T_label(img, label, bbox)
label with flagimg = bbv.draw_flag_with_label(img, label, bbox)
bbox with label insideimg = bbv.draw_rectangle(img, bbox)
img = bbv.add_label(img, label, bbox, top=False)
label with opaque overlayimg = bbv.draw_rectangle(image, bbox, is_opaque=True)
img = bbv.add_label(img, label, bbox, draw_bg=False, top=False)
multiple bboximg = bbv.draw_multiple_rectangles(img, bboxes)
img = bbv.add_multiple_labels(img, labels, bboxes)
multiple flagsimg = bbv.draw_multiple_flags_with_labels(img, labels, bboxes)
multiple T bboximg = 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.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc