Skip to main content

cv-benchkit

CI PyPI License Python

Unified computer vision annotation converter and model benchmarking toolkit for PyTorch and NumPy.


Features

  • Format Converters: Seamless, vectorized conversions between xyxy, xywh (COCO), cxcywh, and normalized (YOLO) bounding-box representations.
  • Dataset Translators: Two-way translations between COCO JSON, YOLO txt, and Pascal VOC XML.
  • Vectorized Evaluation Metrics: Fast NumPy implementations of pairwise IoU, GIoU, and multiclass confusion matrix calculations with background handling.
  • CLI Utility: Command-line interface for fast dataset conversion and validation.
  • Strictly Typed & Tested: 100% typed with PEP 561 marker, passing mypy --strict, with 95%+ unit test coverage.

Installation

Using uv (recommended):

uv add cv-benchkit

Or using pip:

pip install cv-benchkit

Quick Start

Python API

import numpy as np
from cv_benchkit import compute_iou, xyxy_to_normalized, validate_coco_file

# Compute IoU
boxes_a = np.array([[0, 0, 100, 100], [50, 50, 150, 150]])
boxes_b = np.array([[20, 20, 120, 120]])
iou_matrix = compute_iou(boxes_a, boxes_b)
print(iou_matrix)

# Validate and convert COCO annotations
dataset = validate_coco_file("path/to/annotations.json")

CLI

# Validate COCO dataset
cv-benchkit validate annotations.json

# Convert COCO to YOLO format
cv-benchkit convert --from coco --to yolo --input annotations.json --output ./yolo_labels

# Convert YOLO to COCO format
cv-benchkit convert --from yolo --to coco --input ./yolo_labels --output ./coco_out --image-width 640 --image-height 480 --categories person car bicycle

Development

git clone https://github.com/udayraj1238/cv-benchkit.git
cd cv-benchkit
uv sync --extra dev
uv run pytest
uv run ruff check .
uv run mypy src/

Contributing

We welcome community contributions! Please read our CONTRIBUTING.md and check out our Good First Issues Catalog.


License

Apache-2.0. See LICENSE for details.

Metadata

Release files for cv-benchkit 0.1.0

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

Source distribution (sdist)

Source distribution for cv-benchkit 0.1.0
File Size Uploaded Provenance Actions
cv_benchkit-0.1.0.tar.gz 125.2 kB Without provenance Details for cv_benchkit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cv-benchkit 0.1.0
File Interpreter ABI Platform Actions
cv_benchkit-0.1.0-py3-none-any.whl Python 3 none any Details for cv_benchkit-0.1.0-py3-none-any.whl

Total release size: 140.1 kB

Release files / cv_benchkit-0.1.0.tar.gz

Download URL cv_benchkit-0.1.0.tar.gz
Size 125.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7e781b7347caddd1c067cbd4b1560240fdf2ebfd4fd9df950e456d41c22a7728
BLAKE2b-256 checksum
How to use checksums
2e9773cb2b4d85d7e1e631de4e0e8f5c1c477e3a93e207a9fa0fc4963966c9d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cv_benchkit-0.1.0-py3-none-any.whl

Download URL cv_benchkit-0.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ba88023f3762acc9eef0d4956aaf74d3e9dc8aa323df3caa6218fbf3679a5eb
BLAKE2b-256 checksum
How to use checksums
ec32dfc406be496fb5cf66275cc4bc5f7450898fe3c098dbd18a71976fc5bc0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cv-benchkit 0.1.0

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