{"id":13716862,"url":"https://github.com/varunagrawal/bbox","last_synced_at":"2025-10-24T02:21:34.207Z","repository":{"id":34058051,"uuid":"135648953","full_name":"varunagrawal/bbox","owner":"varunagrawal","description":"Python library for 2D/3D bounding boxes","archived":false,"fork":false,"pushed_at":"2023-10-03T21:21:06.000Z","size":6123,"stargazers_count":98,"open_issues_count":4,"forks_count":12,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T16:21:16.282Z","etag":null,"topics":["3d-bounding-boxes","bounding-boxes","computer-vision","computer-vision-tools"],"latest_commit_sha":null,"homepage":"https://varunagrawal.github.io/bbox/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/varunagrawal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-06-01T00:36:16.000Z","updated_at":"2025-02-20T05:06:56.000Z","dependencies_parsed_at":"2023-01-15T04:30:16.626Z","dependency_job_id":"e6c6e296-2b5f-4be3-8113-8853cd264900","html_url":"https://github.com/varunagrawal/bbox","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunagrawal%2Fbbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunagrawal%2Fbbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunagrawal%2Fbbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/varunagrawal%2Fbbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/varunagrawal","download_url":"https://codeload.github.com/varunagrawal/bbox/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254112561,"owners_count":22016792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["3d-bounding-boxes","bounding-boxes","computer-vision","computer-vision-tools"],"created_at":"2024-08-03T00:01:15.160Z","updated_at":"2025-10-24T02:21:28.951Z","avatar_url":"https://github.com/varunagrawal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bbox\n\n`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.\n\n[![Build Status](https://travis-ci.org/varunagrawal/bbox.svg?branch=master)](https://travis-ci.org/varunagrawal/bbox)\n[![codecov](https://codecov.io/gh/varunagrawal/bbox/branch/master/graph/badge.svg)](https://codecov.io/gh/varunagrawal/bbox)\n\n\n[![PyPI version](https://badge.fury.io/py/bbox.svg)](https://badge.fury.io/py/bbox)\n![PyPI format](https://img.shields.io/pypi/format/bbox.svg)\n![](https://img.shields.io/pypi/status/bbox.svg)\n![](https://img.shields.io/pypi/pyversions/bbox.svg)\n\n\n![](https://img.shields.io/pypi/l/bbox.svg)\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/varunagrawal)\n\n\n## Features\n\n### 2D Bounding Box\n\nEasily work with bounding boxes using a simple class that abstracts and maintains various attributes.\n\n```python\nfrom bbox import BBox2D, XYXY\n\n# x, y, w, h\nbox = BBox2D([0, 0, 32, 32])\n\n# equivalently, in (x1, y1, x2, y2) (aka two point format), we can use\nbox = BBox2D([0, 0, 31, 31], mode=XYXY)\n\nprint(box.x1, box.y1)  # -\u003e 0 0\nprint(box.x2, box.y2)  # -\u003e 31 31\nprint(box.height, box.width)  # -\u003e 32 32\n\n# Syntatic sugar for height and width\nprint(box.h, box.w)  # -\u003e 32 32\n```\n### Sequence of 2D bounding boxes\n\nMost tasks involve dealing with multiple bounding boxes. This can also be handled conveniently with the `BBox2DList` class.\n\n```python\nbbl = BBox2DList(np.random.randint(10, 4),\n                 mode=XYWH)\n```\n\nThe above snippet creates a list of 10 bounding boxes neatly abstracted into a convenient object.\n\n### Non-maximum Suppression\n\nNeed to perform non-maximum suppression? It is as easy as a single function call.\n```python\nfrom bbox.utils import nms\n\n# bbl -\u003e BBox2DList\n# scores -\u003e list/ndarray of confidence scores\nnew_boxes = nms(bbl, scores)\n```\n\n### Intersection over Union (Jaccard Index)\n\nThe Jaccard Index or IoU is a very useful metric for finding similarities between bounding boxes. `bbox` provides native support for this.\n\n```python\nfrom bbox.metrics import jaccard_index_2d\n\nbox1 = BBox2D([0, 0, 32, 32])\nbox2 = BBox2D([10, 12, 32, 46])\n\niou = jaccard_index_2d(box1, box2)\n```\n\nWe can even use the Jaccard Index to compute a distance metric between boxes as a distance matrix:\n\n```python\nfrom bbox.metrics import multi_jaccard_index_2d\n\ndist = 1 - multi_jaccard_index_2d(bbl, bbl)\n```\n\n### 3D Bounding Box\n\n`bbox` also support 3D bounding boxes, providing convenience methods and attributes for working with them.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunagrawal%2Fbbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvarunagrawal%2Fbbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvarunagrawal%2Fbbox/lists"}