hotcoco
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 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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hotcoco-1.0.1.tar.gz.
File metadata
- Download URL: hotcoco-1.0.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edc3c449be7dccb35735deccc1683f7f366f946604878293e7776dfddfb9008c
|
|
| MD5 |
91588afa4a21c3a16850a9ba2a5ec466
|
|
| BLAKE2b-256 |
0d251a4dbaf75486129d99ec50a6c4a847b4223b66023363807d4cb3a3618110
|
File details
Details for the file hotcoco-1.0.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: hotcoco-1.0.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b7a1b12d7179b4d0f42925c8773f83777626d2ab489ab1c4928d017f5ab81c7
|
|
| MD5 |
c3c3f06ab06cdc4f23e673d4ed5902ce
|
|
| BLAKE2b-256 |
35e43f1035d900a90dd844cb53b23d894c1f82836db069e66a4c114d2f7e88fa
|
File details
Details for the file hotcoco-1.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hotcoco-1.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79871ea045fad08a98c67186538e03994c8771c1aa2611ccbcfc67654aef6b65
|
|
| MD5 |
29216622ecd2a7614707def3f7d709b2
|
|
| BLAKE2b-256 |
cc4a8293acf91207cf19d068717d0e7e28c0ebc0d32c6fd55cd20fbbc77d4f7b
|
File details
Details for the file hotcoco-1.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: hotcoco-1.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4d5ff99b5c9f27082bffb95aae9000bdee5d8bb3b22ade7f61d5dad1c92c92a
|
|
| MD5 |
01ba11f3ccf19845ba57522418321fe9
|
|
| BLAKE2b-256 |
fb5a8816fad5203a0e41e1e2b07081ea9124f7f90e3fe5988d8495995648c09f
|
File details
Details for the file hotcoco-1.0.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: hotcoco-1.0.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ae500565bfb490d08c9eb5f4ab5d526937420931a6ef72d156075a31b4807d2f
|
|
| MD5 |
7b4c269bf759cfa2772a0974eb104099
|
|
| BLAKE2b-256 |
c5e1e5f198319fe95630526830c877d0cdedf2de263b0c620d8cd3463853eb3f
|
File details
Details for the file hotcoco-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: hotcoco-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9f3b7c4691391bf2ecdabeb14e88f5222c6c370bff102ee27b67e61e276b07b
|
|
| MD5 |
39ba9b38322d71b79451e7763321d4e4
|
|
| BLAKE2b-256 |
4006f293909bd6d9e08620326a3acf39c38af4d6c6de701845ce6cab69f48e98
|