A drop-in replacement for pycocotools, written in Rust. Same numbers, bit for bit. Up to 113× faster. No compiler to install.
pip install hotcocofrom hotcoco import init_as_pycocotools
init_as_pycocotools()
# Every pycocotools import now resolves to hotcoco. Nothing else changes.
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOevalOr import it directly; the API is the same:
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()Documentation | Changelog | Roadmap
- The numbers do not change. The precision, recall, and scores arrays and every summary metric are bit-identical to pycocotools' on COCO val2017, for bbox, segm, and keypoints. Parity is a hard requirement for every change; CONTRIBUTING.md describes how it is verified.
- It is fast. The benchmarks compare hotcoco, pycocotools, and three other evaluators on time and peak memory for bbox, segm, and keypoints on COCO val2017, with the hardware and the method.
- It installs anywhere. Prebuilt wheels for Linux, macOS, and Windows. No Cython, no C compiler, no Microsoft Build Tools.
The same engine covers more than COCO detection. Each item links to its guide.
- LVIS and Open Images protocols, and oriented boxes.
- Panoptic quality, matching panopticapi on val2017, and semantic segmentation, matching mmsegmentation.
- Streaming evaluation inside a validation loop, straight from the detector's prediction array, with shards that merge across ranks.
- TIDE error analysis, confusion matrices, calibration, label-error detection, and model comparison with bootstrap confidence intervals.
- Metric functions on plain arrays, the way
sklearn.metricsworks, for building your own metric. - A dataset browser, a healthcheck, and format conversion to and from YOLO, Pascal VOC, CVAT, DOTA, and Open Images CSV.
- PyTorch integration, plotting, a CLI, type stubs, and a Rust library.
The full list is on the documentation site.
Contributions are welcome. See CONTRIBUTING.md for the architecture overview, build and test workflow, and pre-commit checks.
MIT