Giter Site home page Giter Site logo

odancona / bboxconverter Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 1.0 39.72 MB

This library allows reading and converting bounding box annotations in many popular formats

Home Page: https://bboxconverter.readthedocs.io/en/latest/

License: GNU General Public License v3.0

Python 100.00%
bounding-boxes computer-vision image-recognition numpy object-detection pandas python pytorch tensorflow train-test-split

bboxconverter's Introduction

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

bboxconverter's People

Contributors

odancona avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

richbai90

bboxconverter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.