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 — 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 — boxes, masks, keypoints, and oriented boxes on the COCO, LVIS, and Open Images protocols — panoptic segmentation, verified against panopticapi, and semantic segmentation, verified against mmsegmentation. Tracking is 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.
  • Panoptic quality — hotcoco.panoptic.PanopticEval computes PQ, SQ, and RQ for all, things, and stuff from COCO panoptic JSON + PNG files, or from annotations carrying RLE or polygon masks with no PNG files; pq_compute is a drop-in for panopticapi's. The numbers match panopticapi on COCO val2017. See the panoptic guide.
  • Semantic segmentation — hotcoco.semantic.SemanticEval computes mIoU, fwIoU, mAcc, and aAcc from class-id label maps, fed one batch at a time from a validation loop or read from folders of PNG files; the state is one confusion matrix, so shards merge and the evaluator pickles. The numbers match mmsegmentation and torchmetrics on frozen label maps. See the semantic guide.
  • Streaming evaluation — StreamingEval matches each image as its detections arrive, so a validation epoch ends with only accumulate() and summarize() 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 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 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) with paper_mode for LaTeX/PowerPoint embedding. report() generates a single-page PDF summary. pip install hotcoco[plot]. See plotting.

Explore your data

  • Dataset browser — coco.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 arrays — hotcoco.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 integrations — CocoDetection and CocoEvaluator drop-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 with pip install hotcoco; eval, panoptic eval, semantic eval, healthcheck, stats, filter, merge, split, sample, convert, compare, and explore subcommands. See CLI reference.
  • Rust CLI (coco-eval) — lightweight eval-only binary with eval, panoptic, and semantic subcommands; 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

Metadata

Release files for hotcoco 1.3.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 hotcoco 1.3.0
File Size Uploaded Provenance Actions
hotcoco-1.3.0.tar.gz 1.8 MB Without provenance Details for hotcoco-1.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for hotcoco 1.3.0
File Actions
hotcoco-1.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for hotcoco-1.3.0-cp310-abi3-win_amd64.whl
hotcoco-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for hotcoco-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
hotcoco-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for hotcoco-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
hotcoco-1.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for hotcoco-1.3.0-cp310-abi3-macosx_11_0_arm64.whl
hotcoco-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for hotcoco-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 15.7 MB

Release files / hotcoco-1.3.0.tar.gz

Download URL hotcoco-1.3.0.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
2c4d37bac43389dc897001d0dc40a90f8599cb74e0da390a40f412e0b32a91e6
BLAKE2b-256 checksum
How to use checksums
9c83994ee1dc537c737ae55adb6df72b1310aa028de153493fff1d1aa361af3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hotcoco-1.3.0-cp310-abi3-win_amd64.whl

Download URL hotcoco-1.3.0-cp310-abi3-win_amd64.whl
Size 2.6 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3fedf73d09533a6b46562fe2ca24f1175cb4e049bef1ab9ff5a092606d6b9f22
BLAKE2b-256 checksum
How to use checksums
9ce54edf210cf464b2d6387eb8df25c0e3fd685938f8ce445bf6e05b94148df1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hotcoco-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hotcoco-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.9 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
ee43fd04bb540ac046216eab81bfe7f7660252ee661eafa7e42a3945fb5ff79f
BLAKE2b-256 checksum
How to use checksums
451059caeda72f1a163fbff65420ab20a6ae843189be9095183b8749a251989c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hotcoco-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL hotcoco-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.9 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
0ee0bc4b5b684476fca8b10c0877e7509f53214bde36a492b4598c73844af7db
BLAKE2b-256 checksum
How to use checksums
b1b5e50a732f6b283865e4f74666b389088ff628727fbc91db4730aba72622c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hotcoco-1.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL hotcoco-1.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 2.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b46b49e1c72a51da025e24fc5d7cad8277937d12ae265400f6d1646b18f33c4d
BLAKE2b-256 checksum
How to use checksums
c3913213d211b82ca8b8ccd900893d9f52c2dd491e0ade1580d491db5540e090
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / hotcoco-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL hotcoco-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.8 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b3dbac2e3bf886d063757428c892459b02a2fa229e35651d4ab94c0824443afd
BLAKE2b-256 checksum
How to use checksums
8042baa7d5b0d3aa3a108263050a216b23aacfa93f3ce2cfdd9ee6bda3759793
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for hotcoco 1.3.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