<img src="https://raw.githubusercontent.com/ODAncona/bboxconverter/main/docs/_static/logo.svg" alt="bbox logo" style="display: block; margin-left:auto; margin-right:auto;"></img>
<p align="center">
<a href="https://pypi.org/project/bboxconverter">
<img src="https://img.shields.io/pypi/v/bboxconverter?color=blue" alt="Python versions">
</a>
<a href="https://pepy.tech/project/bboxconverter">
<img src="https://pepy.tech/badge/bboxconverter" alt="Total downloads">
</a>
<a href="https://pypi.org/project/bboxconverter">
<img src="https://img.shields.io/pypi/dm/bboxconverter?color=blue" alt="Monthly downloads">
</a>
<a href="https://pypi.org/project/bboxconverter">
<img src="https://img.shields.io/pypi/pyversions/bboxconverter" alt="Python versions">
</a>
</br>
<a href='https://github.com/ODAncona/bboxconverter/'>
<img src='https://github.com/ODAncona/bboxconverter/actions/workflows/ci.yml/badge.svg'>
</a>
<a href='https://bboxconverter.readthedocs.io/en/latest/?badge=latest'>
<img src='https://readthedocs.org/projects/bboxconverter/badge/?version=latest' alt='Documentation Status'/>
</a>
<a href="https://codecov.io/gh/ODAncona/bboxconverter" >
<img src="https://codecov.io/gh/ODAncona/bboxconverter/branch/main/graph/badge.svg?token=BXGO9JZYWM"/>
</a>
</p>
# 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.
<img src="https://raw.githubusercontent.com/ODAncona/bboxconverter/main/docs/_static/bbox.png" alt="Bounding box example" style="display: block; margin-left:auto; margin-right:auto;"></img>
### 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](<(http://cocodataset.org/)>) (Common Objects in Context)
- [Pascal VOC](<(http://host.robots.ox.ac.uk/pascal/VOC/)>) (Visual Object Classes)
- [YOLO](https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/#yolo) (You Only Look Once)
Furthermore, the bounding box could be stored in **different file formats** like:
- csv
- xml
- json
- manifest
- parquet
- pickle
## Installation
```bash
pip install bboxconverter
```
or
```bash
git clone https://github.com/ODAncona/bboxconverter.git
cd bboxconverter
poetry install
```
See the [installation](https://bboxconverter.readthedocs.io/en/latest/guides/installation.html) 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...
```python
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](https://bboxconverter.readthedocs.io/en/latest/index.html)
## Changelog
See the [CHANGELOG](https://github.com/ODAncona/bboxconverter/blob/main/CHANGELOG.md) file for details.
## Contributing
Contributions are welcome! Please read the [contributing guidelines](https://github.com/ODAncona/bboxconverter/blob/main/CONTRIBUTING.md) first.
## License
This project is licensed under the GPLV3 License - see the [LICENSE](https://github.com/ODAncona/bboxconverter/blob/main/LICENSE) file for details.
## Acknowledgments
- [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/)
- [COCO](http://cocodataset.org/#home)
- [YOLO](https://pjreddie.com/darknet/yolo/)
- [Albumentation](https://albumentations.ai/)
- [Pyodi](https://github.com/Gradiant/pyodi)
Raw data
{
"_id": null,
"home_page": "",
"name": "bboxconverter",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "bbox converter,bbox,converter,bounding box,annotation,coco,yolo,voc,object detection,bboxtools,bboxutils,train,test,split",
"author": "Olivier D'Ancona",
"author_email": "olivier_dancona@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/e0/be/1e7c6a615c82336c6ba6a8a91172ec3096dd71c494c93754514347320a23/bboxconverter-0.1.9.tar.gz",
"platform": null,
"description": "<img src=\"https://raw.githubusercontent.com/ODAncona/bboxconverter/main/docs/_static/logo.svg\" alt=\"bbox logo\" style=\"display: block; margin-left:auto; margin-right:auto;\"></img>\n\n<p align=\"center\">\n <a href=\"https://pypi.org/project/bboxconverter\">\n <img src=\"https://img.shields.io/pypi/v/bboxconverter?color=blue\" alt=\"Python versions\">\n </a>\n <a href=\"https://pepy.tech/project/bboxconverter\">\n <img src=\"https://pepy.tech/badge/bboxconverter\" alt=\"Total downloads\">\n </a>\n <a href=\"https://pypi.org/project/bboxconverter\">\n <img src=\"https://img.shields.io/pypi/dm/bboxconverter?color=blue\" alt=\"Monthly downloads\">\n </a>\n <a href=\"https://pypi.org/project/bboxconverter\">\n <img src=\"https://img.shields.io/pypi/pyversions/bboxconverter\" alt=\"Python versions\">\n </a>\n </br>\n <a href='https://github.com/ODAncona/bboxconverter/'>\n <img src='https://github.com/ODAncona/bboxconverter/actions/workflows/ci.yml/badge.svg'>\n </a>\n <a href='https://bboxconverter.readthedocs.io/en/latest/?badge=latest'>\n <img src='https://readthedocs.org/projects/bboxconverter/badge/?version=latest' alt='Documentation Status'/>\n </a>\n <a href=\"https://codecov.io/gh/ODAncona/bboxconverter\" > \n <img src=\"https://codecov.io/gh/ODAncona/bboxconverter/branch/main/graph/badge.svg?token=BXGO9JZYWM\"/> \n </a>\n</p>\n\n# bboxconverter\n\nbboxconverter 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.\n\n## Introduction\n\n### What is a bounding box?\n\nBounding 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.\n\n<img src=\"https://raw.githubusercontent.com/ODAncona/bboxconverter/main/docs/_static/bbox.png\" alt=\"Bounding box example\" style=\"display: block; margin-left:auto; margin-right:auto;\"></img>\n\n### Various types and format\n\nWhen you work with bounding box you have severals things to consider.\n\nThe bounding box could be stored in **different types** like:\n\n- Top-Left Bottom-Right (TLBR), (x_min, y_min, x_max, y_max)\n- Top-Left Width Height (TLWH), (x_min, y_min, width, height)\n- Center Width Height (CWH), (x_center, y_center, width, height)\n\nWhich are popular among **different formats** like :\n\n- [COCO](<(http://cocodataset.org/)>) (Common Objects in Context)\n- [Pascal VOC](<(http://host.robots.ox.ac.uk/pascal/VOC/)>) (Visual Object Classes)\n- [YOLO](https://albumentations.ai/docs/getting_started/bounding_boxes_augmentation/#yolo) (You Only Look Once)\n\nFurthermore, the bounding box could be stored in **different file formats** like:\n\n- csv\n- xml\n- json\n- manifest\n- parquet\n- pickle\n\n## Installation\n\n```bash\npip install bboxconverter\n```\n\nor\n\n```bash\ngit clone https://github.com/ODAncona/bboxconverter.git\ncd bboxconverter\npoetry install\n```\n\nSee the [installation](https://bboxconverter.readthedocs.io/en/latest/guides/installation.html) guide for more informations.\n\n## Usage\n\nThe goal of this library is to seamlessly convert bounding box format using easy syntax.\n\nIt should be a breeze like...\n\n```python\nimport bboxconverter as bc\n\n# Input file path\ninput_path = './examples/example.csv'\n\n# Output file path\noutput_path = './examples/output/example.json'\n\n# Mapping between the input file and the bboxconverter format\nbbox_map = dict(\n class_name='class',\n file_path='name',\n x_min='top_left_x',\n y_min='top_left_y',\n width='w',\n height='h',\n image_width='img_size_x',\n image_height='img_size_y',\n)\n\n# Read the input file\nparser = bc.read_csv(input_path, mapping=bbox_map)\n\n# Export the file to the desired format\nparser.export(output_path=output_path, format='coco')\nparser.export(output_path=output_path, format='voc')\nparser.export(output_path=output_path, format='yolo')\n```\n\n## Documentation\n\nYou can find the documention online at [bboxconvert.readthedoc.io](https://bboxconverter.readthedocs.io/en/latest/index.html)\n\n## Changelog\n\nSee the [CHANGELOG](https://github.com/ODAncona/bboxconverter/blob/main/CHANGELOG.md) file for details.\n\n## Contributing\n\nContributions are welcome! Please read the [contributing guidelines](https://github.com/ODAncona/bboxconverter/blob/main/CONTRIBUTING.md) first.\n\n## License\n\nThis project is licensed under the GPLV3 License - see the [LICENSE](https://github.com/ODAncona/bboxconverter/blob/main/LICENSE) file for details.\n\n## Acknowledgments\n\n- [Pascal VOC](http://host.robots.ox.ac.uk/pascal/VOC/)\n- [COCO](http://cocodataset.org/#home)\n- [YOLO](https://pjreddie.com/darknet/yolo/)\n- [Albumentation](https://albumentations.ai/)\n- [Pyodi](https://github.com/Gradiant/pyodi)\n\n",
"bugtrack_url": null,
"license": "GLP-3.0",
"summary": "Converting bounding box annotations to popular formats like a breeze.",
"version": "0.1.9",
"project_urls": {
"documentation": "https://bboxconverter.readthedocs.io/en/latest/index.html",
"repository": "https://github.com/ODAncona/bboxconverter.git"
},
"split_keywords": [
"bbox converter",
"bbox",
"converter",
"bounding box",
"annotation",
"coco",
"yolo",
"voc",
"object detection",
"bboxtools",
"bboxutils",
"train",
"test",
"split"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "1fd1489876a10a928023fab8c315c86ce9893195d2108f64cb5ee5d5930fb24b",
"md5": "bc53ebb2a9da47fb833dfeb100de1248",
"sha256": "d97cc130560e4c0fa43e0b4e2678f3795dca11a9fa24e6da11d69b18ae07895c"
},
"downloads": -1,
"filename": "bboxconverter-0.1.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "bc53ebb2a9da47fb833dfeb100de1248",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 29008,
"upload_time": "2023-06-09T21:47:41",
"upload_time_iso_8601": "2023-06-09T21:47:41.085877Z",
"url": "https://files.pythonhosted.org/packages/1f/d1/489876a10a928023fab8c315c86ce9893195d2108f64cb5ee5d5930fb24b/bboxconverter-0.1.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e0be1e7c6a615c82336c6ba6a8a91172ec3096dd71c494c93754514347320a23",
"md5": "3341134080f242e1f693a49c38757139",
"sha256": "2eeac429893d6c7197e34d7ee20b88458a14329940277d4cfe14638f17c5c21f"
},
"downloads": -1,
"filename": "bboxconverter-0.1.9.tar.gz",
"has_sig": false,
"md5_digest": "3341134080f242e1f693a49c38757139",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 25661,
"upload_time": "2023-06-09T21:47:42",
"upload_time_iso_8601": "2023-06-09T21:47:42.454277Z",
"url": "https://files.pythonhosted.org/packages/e0/be/1e7c6a615c82336c6ba6a8a91172ec3096dd71c494c93754514347320a23/bboxconverter-0.1.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-09 21:47:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ODAncona",
"github_project": "bboxconverter",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "bboxconverter"
}