Skip to main content

hotcoco

CI PyPI Crates.io License: MIT

Fast enough for every epoch, lean enough for every dataset. A drop-in replacement for pycocotools that doesn't become the bottleneck — in your training loop or at foundation model scale. Up to 23× faster on standard COCO, 39× faster on Objects365, and fits comfortably in memory where alternatives run out.

Available as a Python package, CLI tool, and Rust library. Pure Rust — no Cython, no C compiler, no Microsoft Build Tools. Prebuilt wheels for Linux, macOS, and Windows.

Beyond raw speed, hotcoco ships a diagnostic toolkit that pycocotools and faster-coco-eval don't have: TIDE error breakdown, cross-category confusion matrix, per-category AP, F-scores, confidence calibration (ECE/MCE), per-image diagnostics with label error detection, sliced evaluation, dataset healthcheck, and publication-quality plots with a one-call PDF report. Same pip install, no extra config.

Documentation | Changelog | Roadmap

Performance

Benchmarked on COCO val2017 (5,000 images, 36,781 synthetic detections), Apple M1 MacBook Air:

Eval Type pycocotools faster-coco-eval hotcoco
bbox 9.46s 2.45s (3.9×) 0.41s (23.0×)
segm 9.16s 4.36s (2.1×) 0.49s (18.6×)
keypoints 2.62s 1.78s (1.5×) 0.21s (12.7×)

Speedups in parentheses are vs pycocotools. Results verified against pycocotools on COCO val2017 with a 10,000+ case parity test suite — your AP scores won't change.

At scale (Objects365 val — 80k images, 365 categories, 1.2M detections), hotcoco completes in 18s vs 721s for pycocotools and 251s for faster-coco-eval — 39× and 14× faster respectively — while using half the memory. See the full benchmarks.

Get started

pip install hotcoco

No Cython, no C compiler, no Microsoft Build Tools. Prebuilt wheels for Linux, macOS, and Windows.

Already using pycocotools? One line:

from hotcoco import init_as_pycocotools
init_as_pycocotools()

Or use it directly — the API is identical:

from hotcoco import COCO, COCOeval

coco_gt = COCO("instances_val2017.json")
coco_dt = coco_gt.load_res("detections.json")

ev = COCOeval(coco_gt, coco_dt, "bbox")
ev.run()

What's included

  • COCO, LVIS & Open Images evaluation — bbox, segmentation, keypoints, and oriented bounding box (OBB); all standard metrics plus LVIS federated eval (APr/APc/APf) and Open Images hierarchy-aware eval (group-of matching, GT expansion). OBB evaluation uses rotated IoU via polygon clipping for aerial imagery, document analysis, and scene text. See the evaluation guide.
  • Confidence calibration — ECE/MCE metrics and reliability diagrams measure whether your model's confidence scores are meaningful. See calibration.
  • Model comparisonhotcoco.compare(eval_a, eval_b) with per-metric deltas, per-category AP breakdown, and bootstrap confidence intervals for statistical significance. See model comparison.
  • Per-image diagnostics & label errors — per-image F1/AP scores, automatic detection of wrong labels and missing annotations in your ground truth. See diagnostics.
  • TIDE error analysis — breaks down every FP and FN into six error types so you know why your model falls short, not just by how much. See TIDE errors.
  • Confusion matrix — cross-category matching with per-class breakdowns. See confusion matrix.
  • F-scores — F-beta averaging over precision/recall curves, analogous to mAP. See F-scores.
  • Plotting — publication-quality PR curves, per-category AP, confusion matrices, and TIDE error breakdowns. Four built-in themes (cold-brew, warm-slate, scientific-blue, ember) with paper_mode for LaTeX/PowerPoint embedding. report() generates a single-page PDF summary. pip install hotcoco[plot]. See plotting.
  • Sliced evaluation — re-accumulate metrics for named image subsets (indoor/outdoor, day/night) without recomputing IoU. See sliced evaluation.
  • Dataset healthcheck — 4-layer validation (structural, quality, distribution, GT/DT compatibility) catches duplicate IDs, degenerate bboxes, category imbalance, and more. See healthcheck.
  • Format conversion — COCO ↔ YOLO, COCO ↔ Pascal VOC, and COCO ↔ CVAT from Python or the CLI; COCO ↔ DOTA from Python. See format conversion.
  • PyTorch integrationsCocoDetection and CocoEvaluator drop-in replacements for torchvision's detection classes; no torchvision or pycocotools dependency required. See PyTorch integration.
  • Experiment tracker integrationget_results(prefix="val/bbox", per_class=True) returns a flat dict ready for W&B, MLflow, or any logger. See logging metrics.
  • Dataset browsercoco.browse() / coco explore opens a local browser with category filter, annotation overlays (bbox/segm/keypoints), hover-to-highlight, zoom/pan, and detection comparison. Pass eval= to enable an interactive eval dashboard with PR curves, confusion matrix, TIDE errors, calibration, and per-image F1. pip install hotcoco[browse]. See Dataset Browser.
  • Python CLI (coco) — included with pip install hotcoco; eval, healthcheck, stats, filter, merge, split, sample, convert, compare, and explore subcommands. See CLI reference.
  • Rust CLI (coco-eval) — lightweight eval-only binary; cargo install hotcoco-cli. See CLI reference.
  • Type stubs — ships with .pyi stubs and py.typed marker for full autocomplete and type checking in VS Code, PyCharm, and other IDEs.
  • Rust library — use hotcoco directly in your Rust projects via cargo add hotcoco. See Rust API.

See the documentation for full API reference and examples.

Contributing

Contributions are welcome. The core library is pure Rust in crates/hotcoco/ — if you're new to Rust but comfortable with Python and the COCO spec, the PyO3 bindings in crates/hotcoco-pyo3/ are a gentler entry point.

Before submitting a PR, run the pre-commit checks locally:

cargo fmt --all
cargo clippy --workspace --all-targets -- -D warnings
cargo test

Parity with pycocotools is a hard requirement — if your change touches evaluation logic, verify metrics haven't shifted with just parity.

License

MIT

Download files

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

Source Distribution

hotcoco-0.5.0.tar.gz (387.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hotcoco-0.5.0-cp39-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

hotcoco-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

hotcoco-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

hotcoco-0.5.0-cp39-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

hotcoco-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file hotcoco-0.5.0.tar.gz.

File metadata

  • Download URL: hotcoco-0.5.0.tar.gz
  • Upload date:
  • Size: 387.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hotcoco-0.5.0.tar.gz
Algorithm Hash digest
SHA256 96d5812dd8ef87040f393c2691bdb8d32c37e05dfbe716dd2aa94fbcead3fd14
MD5 c708da9da46fad790f5560018194bc73
BLAKE2b-256 ca03bccb0da7a5ab8134d759cfb84a009885a4c24d09509268ae5edd4b7c60ff

See more details on using hashes here.

File details

Details for the file hotcoco-0.5.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: hotcoco-0.5.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for hotcoco-0.5.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 37b4678fcd9fa41627e03ef9624cb883978fd110dcbdbc1c5f2e1795101dcece
MD5 6df97cb624e6d44a3e2275db061784b3
BLAKE2b-256 9bf864e0f8640b7ff37befb28275dd7dbfa665f724934c548c505cae0e966238

See more details on using hashes here.

File details

Details for the file hotcoco-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hotcoco-0.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b9bb8f5bcd1e4befd9533758449439b39b1548837d99f98674bcb5ab3465062
MD5 7871103c6d2aa5aadbb73e07e5b7eca5
BLAKE2b-256 f2e89ef281559337f37ad45501a57fb340864965b7a5eae64236f41b18f5d82c

See more details on using hashes here.

File details

Details for the file hotcoco-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hotcoco-0.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91d5114f58a1b7823b0b9911fe1e3cd33453335db4f37b8cc896eb0539367db0
MD5 b5bcfe041cf5a146bbcd0896bd8b5a8c
BLAKE2b-256 7500a253382c3a0213e35e90d53b7b39cc4d0a596eefc6d1dbcbf396508ddcb7

See more details on using hashes here.

File details

Details for the file hotcoco-0.5.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hotcoco-0.5.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9177aff131a579bf287dd750834ca495fd4a464327784dfc4f6a53cd66f0ddae
MD5 22a2b131aceb98e1c2a89f685df5dd1f
BLAKE2b-256 2084fc7bb5b34e52a26278e7928171979ffd5212db99196d5794c41e25cbe43a

See more details on using hashes here.

File details

Details for the file hotcoco-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for hotcoco-0.5.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4c68eb8a98dc411c44c89d398b484397425432bdb384123b1489ae46c94d17ce
MD5 c51a459abd7b6d48df2b89e404b4991c
BLAKE2b-256 21d24d8ebae2d732bbf4fdc04cbbc265307e96a16cc9718d14ecddad3867ab6d

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

6 files

1.0.0

6 files

This release

0.5.0 This release

6 files

0.4.1

6 files

0.4.0

7 files

0.3.0

7 files

0.2.0

8 files

0.1.0

8 files

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