Skip to main content

bbox logo

Python versions Total downloads Monthly downloads Python versions
Documentation Status

bboxconverter

bboxconverter is a Python library that enables seamless conversion of bounding box formats between various types and file formats. It provides an easy-to-use syntax for reading and exporting bounding box files.

Introduction

What is a bounding box?

Bounding boxes are a crucial component of object detection algorithms, which are used to identify and classify objects within an image or video. A bounding box is a rectangle that surrounds an object of interest in the image, and is typically represented by a set of coordinates that define the box's position and size.

Bounding box example

Various types and format

When you work with bounding box you have severals things to consider.

The bounding box could be stored in different types like:

  • Top-Left Bottom-Right (TLBR), (x_min, y_min, x_max, y_max)
  • Top-Left Width Height (TLWH), (x_min, y_min, width, height)
  • Center Width Height (CWH), (x_center, y_center, width, height)

Which are popular among different formats like :

  • COCO (Common Objects in Context)
  • Pascal VOC (Visual Object Classes)
  • YOLO (You Only Look Once)

Furthermore, the bounding box could be stored in different file formats like:

  • csv
  • xml
  • json
  • manifest
  • parquet
  • pickle

Installation

pip install bboxconverter

or

git clone https://github.com/ODAncona/bboxconverter.git
cd bboxconverter
poetry install

See the installation guide for more informations.

Usage

The goal of this library is to seamlessly convert bounding box format using easy syntax.

It should be a breeze like...

import bboxconverter as bc

# Input file path
input_path = './examples/example.csv'

# Output file path
output_path = './examples/output/example.json'

# Mapping between the input file and the bboxconverter format
bbox_map = dict(
    class_name='class',
    file_path='name',
    x_min='top_left_x',
    y_min='top_left_y',
    width='w',
    height='h',
    image_width='img_size_x',
    image_height='img_size_y',
)

# Read the input file
parser = bc.read_csv(input_path, mapping=bbox_map)

# Export the file to the desired format
parser.export(output_path=output_path, format='coco')
parser.export(output_path=output_path, format='voc')
parser.export(output_path=output_path, format='yolo')

Documentation

You can find the documention online at bboxconvert.readthedoc.io

Changelog

See the CHANGELOG file for details.

Contributing

Contributions are welcome! Please read the contributing guidelines first.

License

This project is licensed under the GPLV3 License - see the LICENSE file for details.

Acknowledgments

Metadata

Release files for bboxconverter 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bboxconverter 0.1.9
File Size Uploaded Provenance Actions
bboxconverter-0.1.9.tar.gz 25.7 kB Without provenance Details for bboxconverter-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bboxconverter 0.1.9
File Interpreter ABI Platform Actions
bboxconverter-0.1.9-py3-none-any.whl Python 3 none any Details for bboxconverter-0.1.9-py3-none-any.whl

Total release size: 54.7 kB

Release files / bboxconverter-0.1.9.tar.gz

Download URL bboxconverter-0.1.9.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2eeac429893d6c7197e34d7ee20b88458a14329940277d4cfe14638f17c5c21f
BLAKE2b-256 checksum
How to use checksums
e0be1e7c6a615c82336c6ba6a8a91172ec3096dd71c494c93754514347320a23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / bboxconverter-0.1.9-py3-none-any.whl

Download URL bboxconverter-0.1.9-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d97cc130560e4c0fa43e0b4e2678f3795dca11a9fa24e6da11d69b18ae07895c
BLAKE2b-256 checksum
How to use checksums
1fd1489876a10a928023fab8c315c86ce9893195d2108f64cb5ee5d5930fb24b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Security for bboxconverter 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page