Skip to content

CI Coverage Crates.io pypi versions

PowerBoxes

Powerboxes is a package containing utility functions for transforming bounding boxes and computing metrics. It is implemented in both Python and Rust. It shows a significant speedup over the equivalent numpy implementations in Python, or other libraries such as shapely or torchvision.

See source code here

Installation

pip install powerboxes

Example Usage

import powerboxes as pb
import numpy as np

# Create a bounding box
box = np.array([[0, 0, 1, 1]])

# Compute the area of the box
area = pb.box_areas(box)

# Compute the intersection of the box with itself
intersection = pb.iou_distance(box, box)

supported dtypes by most functions

powerboxes.supported_dtypes = ['float64', 'float32', 'int16', 'int32', 'int64', 'uint8', 'uint16', 'uint32', 'uint64'] module-attribute