hotcoco
A drop-in replacement for pycocotools — 11-26x faster COCO evaluation for object detection, segmentation, and keypoints.
Available as a Python package, CLI tool, and Rust library.
Documentation | Changelog | Roadmap
Performance
Benchmarked on COCO val2017 (5,000 images, 36,781 ground truth annotations, ~43,700 detections), Apple M1 MacBook Air:
| Eval Type | pycocotools | faster-coco-eval | hotcoco |
|---|---|---|---|
| bbox | 11.79s | 3.47s (3.4x) | 0.74s (15.9x) |
| segm | 19.49s | 10.52s (1.9x) | 1.58s (12.3x) |
| keypoints | 4.79s | 3.08s (1.6x) | 0.19s (25.0x) |
Speedups in parentheses are vs pycocotools. All metrics match pycocotools within 0.003 (many are exact).
Quick Start
Python
=
=
=
Drop-in replacement for pycocotools
If you have existing code that imports from pycocotools and don't want to change every import, call init_as_pycocotools() once at startup:
# Existing code works unchanged
CLI
Rust
use ;
use IouType;
use Path;
let coco_gt = COCOnew?;
let coco_dt = coco_gt.load_res?;
let mut eval = new;
eval.evaluate;
eval.accumulate;
eval.summarize;
License
MIT