Skip to main content

Lightweight package for managing bounding boxes that works seamlessly with most computing frameworks.

Project description

Logo

Lightweight package for managing bounding boxes that works seamlessly with most computing frameworks.

CI/CD CI Pipeline Release interrogate codecov
Package PyPI - Version PyPI - Python Version
Meta linting - Ruff code style - Black imports - isort pre-commit License

This package provides a simple API for managing bounding boxes. It allows you to perform transformation to your Numpy's ndarray, JAX's Array, PyTorch Tensor or Tensorflow Tensor from one orientation to another.

️️⚙️ Installation

Install the package from the PyPI registry. You may need to specify the framework that you want to managed. Numpy is enabled by default.

pip install anyboxes
# or
pip install "anyboxes[torch]" # or jax, tensorflow

Install the package from the latest commit of the repository.

pip install git+https://github.com/VDuchauffour/anyboxes

⚡ Usage

In a nutshell, the common workflow involve 3 stages:

  • Instantiate a Boxes object with one of the following classmethod: from_top_left_corner, from_bottom_left_corner, from_two_corners, from_center
  • Apply a transformation with a to inplace method: to_top_left_corner, to_bottom_left_corner, to_two_corners, to_center
  • Retrieve the modified data with one of the property: as_dict, as_tuple, as_array, as_numpy, as_tensor

To be more specific, when a Boxes is instantiated, the following attribute are created:

  • corners_coordinates attribute (a tuple from top to bottom and from left to right).
  • center_coordinates attribute
  • shape attribute (width and height)
  • origin attribute (which can be equal to top-left or bottom-left, modify this attribute will rearrange the coordinates)

⛏️ Development

Clone the project

git clone https://github.com/VDuchauffour/anyboxes

In order to install all development dependencies, run the following command:

pip install -e ".[dev]"

To ensure that you follow the development workflow, please setup the pre-commit hooks:

pre-commit install

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anyboxes-0.1.0.tar.gz (41.9 kB view details)

Uploaded Source

Built Distribution

anyboxes-0.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file anyboxes-0.1.0.tar.gz.

File metadata

  • Download URL: anyboxes-0.1.0.tar.gz
  • Upload date:
  • Size: 41.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for anyboxes-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c5c41d8e714efa332c8d5b16f34cc1ec5138e89f7eab520fcd3eb22347d75f61
MD5 e82aa80329ead558434cb19fbd67d48b
BLAKE2b-256 0c6d184bcc0d36e7ee443949806225c05a17976c7b16bbe864c1f00049b39acf

See more details on using hashes here.

File details

Details for the file anyboxes-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: anyboxes-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for anyboxes-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf01102185da4131c1a7a6f9529e7310402b5471a6ffbf6a9c90d45fc97ccead
MD5 54d13831203c8815cdadb1c28a4e51ee
BLAKE2b-256 a1afd91b0cbbd83748d752b509e79920f3986defe371eeb0e6725c4390be474a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page