Skip to main content

Simple bounding box operations

Project description

Package bbx

Simple operations over bounding boxes. The package provides a class Boxes encapsulating a set of bounding boxes. Internally, the boxes are represented in an Nx4 matrix with x1,y1,x2,y2 coordinates. Instances of Boxes support arbitraty user-defined fields which can hold other properties of boxes like e.g. score.

import bbx

B = bbx.Boxes(np.array([[0,0,10,10]]))  # New instance. Explicit conversion to array required
B.set_field("score", np.array([1]))  # Set the field
B.width()  # [[10]]
C = bbx.resize(B, 2)  # Resize and make new instance
C.get() # [[-5,-5,15,15]]


The package is in PyPI so just use pip

pip install bbx


If you find the package useful, contribute with code. You can also submit an issue if something is broken.


This code is published under MIT License

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 bbx, version 0.0.5
Filename, size File type Python version Upload date Hashes
Filename, size bbx-0.0.5-py3-none-any.whl (5.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size bbx-0.0.5.tar.gz (3.6 kB) File type Source Python version None 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