hotcoco
hotcoco is a perception evaluation toolkit, written in Rust with Python bindings. It's a drop-in replacement for pycocotools — the same numbers bit for bit, up to 113× 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.05s against 5.11s for pycocotools; segm is ~111× faster and keypoints ~55×. Peak memory is a third of pycocotools' or less at every scale measured. Two other Rust evaluators, ultrafast-pycocotools and vernier, are in the same speed class; the benchmarks page compares all five on time and memory. The precision, recall, and scores arrays and every summary metric are bit-identical to pycocotools', 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.
- Streaming evaluation —
StreamingEvalmatches each image as its detections arrive, so a validation epoch ends with onlyaccumulate()andsummarize()left to run; the numbers are identical to a batch run. It takes the detector's prediction array directly, and shards streamed on separate ranks merge into one result. See streaming evaluation. - Evaluation reports —
ev.report()returns metrics, per-class and per-group breakdowns, plottable PR curves, and aprovenancefield 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 comparison —
hotcoco.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) withpaper_modefor LaTeX/PowerPoint embedding.report()generates a single-page PDF summary.pip install hotcoco[plot]. See plotting.
Explore your data
- Dataset browser —
coco.browse()/coco exploreopens a local browser with category filter, annotation overlays (bbox/segm/keypoints/OBB), hover-to-highlight, zoom/pan, and detection comparison. Passeval=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 arrays —
hotcoco.metricsandhotcoco.primitivesexpose the engine as free functions, the waysklearn.metricsandtorchmetrics.functionaldo. No evaluator, no dataset, no COCO JSON:metrics.average_precision(scores, matched, num_gt=...),primitives.lsap(cost).COCOevalcalls the same functions, so the numbers cannot diverge. See metrics and primitives. - PyTorch integrations —
CocoDetectionandCocoEvaluatordrop-in replacements for torchvision's detection classes; no torchvision or pycocotools dependency required. See PyTorch integration. - Experiment tracker integration —
get_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 withpip install hotcoco;eval,healthcheck,stats,filter,merge,split,sample,convert,compare, andexploresubcommands. See CLI reference. - Rust CLI (
coco-eval) — lightweight eval-only binary;cargo install hotcoco-cli. See CLI reference. - Type stubs — ships with
.pyistubs andpy.typedmarker 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
Metadata
Release files for hotcoco 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hotcoco-1.2.1.tar.gz | 1.7 MB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| hotcoco-1.2.1-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| hotcoco-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| hotcoco-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| hotcoco-1.2.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| hotcoco-1.2.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 14.0 MB
Release files / hotcoco-1.2.1.tar.gz
| Download URL | hotcoco-1.2.1.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2f8404358e072ef4979b2ab0f4a7a2c545a5699306f22d19d004ab1c610af86c
|
|
BLAKE2b-256 checksum How to use checksums |
166277906c286d1b041b90844b6e242f281c14ecda33e36b3239bbc825583a33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hotcoco-1.2.1-cp310-abi3-win_amd64.whl
| Download URL | hotcoco-1.2.1-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9f8c3ad61eec430276119fcd57cbfb69b5008fa0db8e504f4614b2eb95982cdd
|
|
BLAKE2b-256 checksum How to use checksums |
9d04fb6f45b7cf3ed2c354420260ced052e9d3ff9b9db8c4c249e22d904f6dcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hotcoco-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | hotcoco-1.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
06322c544d42027b70029233e2afca2b6e1f6d666e6a96ab28f4490d9fec0c6c
|
|
BLAKE2b-256 checksum How to use checksums |
15b46d7296e7bec8623655e994aa17ffd1abcb6fc3b2350db870c559daa8f1e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hotcoco-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | hotcoco-1.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
38f04e5d2bbc8ac11c939662fc28c911940c9a9c5a75d963d75e3fc612b68751
|
|
BLAKE2b-256 checksum How to use checksums |
c275854a7cd189cc02606848fe6fe2ed4b0503a7ff51d7fd0dee8c4a4a11b77c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hotcoco-1.2.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | hotcoco-1.2.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.4 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6b9c14483b4cd0c056378b38ce0b0488cfe910579b457af78eafc2ea699028ad
|
|
BLAKE2b-256 checksum How to use checksums |
df5d6e16d2709624305da75091139783b5927e5446e957390e40663a5b85d025
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / hotcoco-1.2.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | hotcoco-1.2.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.5 MB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
49540b895079461715de6bc27d20d9db322c2b921ed948bcf669069537921980
|
|
BLAKE2b-256 checksum How to use checksums |
33eef89524fc5ae7afd4ed732b2351d1d44b0ccd4e2cb077281df15f5a64294e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|