百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
B

bbox

> 编程语言
开源

用于 2D/3D 边界框的 Python 库

100 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

用于 2D/3D 边界框的 Python 库

bbox

bbox a Python library that is intended to ease the use of 2D and 3D bounding boxes in areas such as Object Detection by providing a set of flexible primitives and functions that are intuitive and easy to use out of the box.

Features

2D Bounding Box

Easily work with bounding boxes using a simple class that abstracts and maintains various attributes.

python
from bbox import BBox2D, XYXY

# x, y, w, h
box = BBox2D([0, 0, 32, 32])

# equivalently, in (x1, y1, x2, y2) (aka two point format), we can use
box = BBox2D([0, 0, 31, 31], mode=XYXY)

print(box.x1, box.y1)  # -> 0 0
print(box.x2, box.y2)  # -> 31 31
print(box.height, box.width)  # -> 32 32

# Syntatic sugar for height and width
print(box.h, box.w)  # -> 32 32

Sequence of 2D bounding boxes

Most tasks involve dealing with multiple bounding boxes. This can also be handled conveniently with the BBox2DList class.

python
bbl = BBox2DList(np.random.randint(10, 4),
                 mode=XYWH)

The above snippet creates a list of 10 bounding boxes neatly abstracted into a convenient object.

Non-maximum Suppression

Need to perform non-maximum suppression? It is as easy as a single function call.

python
from bbox.utils import nms

# bbl -> BBox2DList
# scores -> list/ndarray of confidence scores
new_boxes = nms(bbl, scores)

Intersection over Union (Jaccard Index)

The Jaccard Index or IoU is a very useful metric for finding similarities between bounding boxes. bbox provides native support for this.

python
from bbox.metrics import jaccard_index_2d

box1 = BBox2D([0, 0, 32, 32])
box2 = BBox2D([10, 12, 32, 46])

iou = jaccard_index_2d(box1, box2)

We can even use the Jaccard Index to compute a distance metric between boxes as a distance matrix:

python
from bbox.metrics import multi_jaccard_index_2d

dist = 1 - multi_jaccard_index_2d(bbl, bbl)

3D Bounding Box

bbox also support 3D bounding boxes, providing convenience methods and attributes for working with them.

Issues· 5 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Python3d-bounding-boxesbounding-boxescomputer-visioncomputer-vision-tools

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言