Skip to main content

hotcoco

CI PyPI Crates.io License: MIT

hotcoco is a perception evaluation toolkit, written in Rust with Python bindings. It's a drop-in replacement for pycocotools — same numbers to double precision, up to 36× faster — plus the analysis that usually lives in separate tools: TIDE error analysis, confusion matrices, confidence calibration, model comparison, label-error detection, and a dataset browser.

It covers detection today — boxes, masks, keypoints, and oriented boxes on the COCO, LVIS, and Open Images protocols. Panoptic and tracking are planned, on the same engine.

Pure Rust, available as a Python package, CLI tool, and Rust library.

Documentation | Changelog | Roadmap

Performance

Bbox evaluation on COCO val2017 runs in 0.14s against 5.11s for pycocotools; segm and keypoints see ~20×. Every COCO metric matches pycocotools to the limit of double precision, so your AP scores don't change.

Full tables, hardware, the Objects365 scale run, phase breakdowns, and parity verification: 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

Evaluate

  • COCO, LVIS, and 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 and LVIS and Open Images.
  • Evaluation reportsev.report() returns metrics, per-class and per-group breakdowns, plottable PR curves, and a provenance field that says whether each number is comparable to a published leaderboard or is a hotcoco extension. See the evaluation report.

Diagnose

  • TIDE error analysis — classifies every false positive and false negative into one of six error types and reports how much AP each type costs. See TIDE errors.
  • Confusion matrix — cross-category matching with per-class breakdowns. See confusion matrix.
  • Confidence calibration — ECE/MCE metrics and reliability diagrams measure whether your model's confidence scores are meaningful. See calibration.
  • Per-image diagnostics and label errors — per-image F1/AP scores, automatic detection of wrong labels and missing annotations in your ground truth. See diagnostics.
  • 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.
  • F-scores — F-beta averaging over precision/recall curves, analogous to mAP. See F-scores.
  • Sliced evaluation — re-accumulate metrics for named image subsets (indoor/outdoor, day/night) without recomputing IoU. See sliced evaluation.
  • Plotting — publication-quality PR curves, per-category AP, confusion matrices, and TIDE error breakdowns. Light and dark themes (cyanotype, cyanotype-dark) with paper_mode for LaTeX/PowerPoint embedding. report() generates a single-page PDF summary. pip install hotcoco[plot]. See plotting.

Explore your data

  • Dataset browsercoco.browse() / coco explore opens a local browser with category filter, annotation overlays (bbox/segm/keypoints/OBB), 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.
  • 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, Pascal VOC, CVAT, DOTA (oriented boxes), and Open Images CSV, from Python or the CLI. See format conversion.

Compose and integrate

  • Metric functions on plain arrayshotcoco.metrics and hotcoco.primitives expose the engine as free functions, the way sklearn.metrics and torchmetrics.functional do. No evaluator, no dataset, no COCO JSON: metrics.average_precision(scores, matched, num_gt=...), primitives.lsap(cost). COCOeval calls the same functions, so the numbers cannot diverge. See metrics and primitives.
  • 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.
  • 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.

Contributing

Contributions are welcome. See CONTRIBUTING.md for the architecture overview, build and test workflow, and pre-commit checks.

Parity with pycocotools is a hard requirement for any change to evaluation logic; CONTRIBUTING.md describes how to verify it.

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-1.0.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

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

hotcoco-1.0.0-cp39-abi3-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.9+Windows x86-64

hotcoco-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

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

hotcoco-1.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

hotcoco-1.0.0-cp39-abi3-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

hotcoco-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: hotcoco-1.0.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hotcoco-1.0.0.tar.gz
Algorithm Hash digest
SHA256 bd36bd6f171c4fa06d607461fcac1fd84a7017567d0c85a9d52110b1e3677e46
MD5 1db9a1feef2aac30216e5758ce57e42c
BLAKE2b-256 9c07b6609adecd1325a9bcf0ba4129a75ea6e9cb3ad3bc87ab0fc3c04448e3b4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for hotcoco-1.0.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6dc15de092ce21bc3c7e75978bd45a7587253038e118fb25299a059ae76541a0
MD5 c1a4542001b7589046177d9c52ad2c05
BLAKE2b-256 3cf8c950e8e760116b1e9eacf49512db8c5576b29a2243e8fc71652d8244b20b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hotcoco-1.0.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 202f20a02227b791d5073ae304662813ca0a0e2c5d0e1fc66b4adc06843992ee
MD5 b7d73918e5f3d25167fb93bd144c33fd
BLAKE2b-256 bdac4ca633c1abe81f1cbb91d37eeaffebba563d2cb7fd21250002b45047e26c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hotcoco-1.0.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 05f250cd33e30ddf00a134f4ad58090054061b23414475a0c8f3bd88a77a33ff
MD5 704b84d45d03004780ab09d10999f9ff
BLAKE2b-256 a60ea48cf79b8f61daeeb5909efecd5b705944d50225b20f0992b91b6348c49b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hotcoco-1.0.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 68251ca62605606f536c88bf37f225f6671cfbee85b4beb166c8f84fb9a3a0f5
MD5 5c1b3238d149986efd3594b7ee54f581
BLAKE2b-256 ca922b78227498552547a902581cee1763a5af46f9c711f9b02d7cda93d45d85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for hotcoco-1.0.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 1f48052d5556f2c39a03483d8dc0a8e89f019c908ef2e025aa36c2966bb3140c
MD5 bfe44a11376f337fe9dd6506efad6641
BLAKE2b-256 e33dd034548344fe331d52c02043841de7555df82546c9eed50f35c5699e7144

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.1

6 files

This release

1.0.0 This release

6 files

0.5.0

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