Skip to main content

High-performance, parity-preserving COCO-style evaluation

Project description

vernier

CI PyPI crates.io vernier-core crates.io vernier-mask crates.io vernier-cli License: MIT OR Apache-2.0

Fast, parity-preserving evaluation for object detection, instance / panoptic / semantic segmentation, boundary IoU, OKS keypoints, LVIS federated, LRP / oLRP error decomposition, and detection-family calibration (ECE / MCE / reliability). Rust core, Python frontend, optional CLI.

60-second example

One-shot — predictions already serialized to JSON (end-of-epoch checkpoint, CI gate, post-training inspection):

from pathlib import Path
from vernier.instance import Bbox, CocoDataset, Evaluator

gt_bytes = Path("instances_val2017.json").read_bytes()
dt_bytes = Path("detections.json").read_bytes()

dataset = CocoDataset.from_json(gt_bytes)
summary = Evaluator(iou=Bbox()).evaluate(dataset, dt_bytes)
for line in summary.pretty_lines():
    print(line)

In a training loop — overlap eval with the data loading and inference. The matching kernel runs on a worker thread, so submit(...) returns immediately and the main thread keeps moving. Passing a CocoDataset reuses the parsed-once GT and its per-kernel derivation cache across every epoch (ADR-0020):

import json
from pathlib import Path
from vernier.instance import Bbox, CocoDataset, Evaluator

gt = CocoDataset.from_json(Path("instances_val2017.json").read_bytes())
evaluator = Evaluator(iou=Bbox())
with evaluator.background(gt) as bg:
    for images, _ in val_loader:
        detections = model(images)  # list[{image_id, category_id, bbox, score}]
        bg.submit(json.dumps(detections).encode())
    summary = bg.finalize()
print("AP =", summary.stats[0])

Both end in the same 12-line pycocotools-shaped Summary; docs/tutorials/first-evaluation.md walks each end-to-end.

Benchmarks

Workload vernier median Speedup vs alternatives
Instance — bbox AP (val2017) 360 ms 5.9× faster-coco-eval · 16.2× pycocotools
Instance — segm AP (val2017) 968 ms 3.7× faster-coco-eval · 7.1× pycocotools
Instance — boundary AP (val2017) 3.1 s 5.7× faster-coco-eval · 19.9× boundary-iou-api
Instance — keypoints AP (val2017, OKS) 136 ms 12.5× faster-coco-eval · 17.1× pycocotools
Panoptic — PQ (val2017) 11.6 s 3.04× panopticapi
Semantic — mIoU (val2017) 5.1 s 4.2× mmsegmentation
Instance — LVIS bbox AP (v1 val, perfect-DT) 3.7 s 56.9× lvis-api · 10× lower peak RSS (1.49 GiB vs 15.01 GiB)

Median total-stage wall time on a KVM VPS (AMD EPYC-Milan, 4 cores × 2 threads = 8 logical CPUs, x86_64 — not a bare-metal Milan box), harness mode release (N=10 measurement reps + 2 warmup, randomised impl order, 5% relative-IQR gate per impl), build profile = cargo release defaults (opt-level=3, lto=thin, codegen-units=1, no target-cpu) — same as the PyPI wheel. Full per-cell breakdown (including IQRs), RSS, and methodology in docs/benchmarks.md; per-library comparison of when to pick which in docs/comparison.md.

Baselines pinned for these numberspycocotools==2.0.11, faster-coco-eval==1.7.2, panopticapi @ 7bb4655, boundary-iou-api @ 37d2558, mmsegmentation @ c685fe6 (vendored), lvis-api @ 031ac21 (PyPI lvis==0.5.3). COCO and panoptic / semantic numbers were measured at HEAD 1fd5720bf56c; the LVIS row was added at HEAD e9d9c4d71303 after the bench paradigm landed. Each baseline is locked in its own uv-managed venv per ADR-0017.

Install

pip install vernier                  # Python wheel
cargo add vernier-core               # Rust library
cargo install vernier-cli            # `vernier` CLI binary

Wheels ship for linux x86_64 / aarch64 (glibc + musl), macOS x86_64 / arm64, and windows x64. The umbrella vernier crate name on crates.io is held as a 0.0.0 placeholder; vernier-core is the real Rust entry point — see docs/engineering/registry-reservations.md.

Status & validation

Pre-1.0; public API is unstable. See docs/adr/ for the design decisions shaping it.

pycocotools==2.0.11 is the de-facto reference for COCO evaluation — slow, unmaintained, and full of edge-case quirks. Faster reimplementations exist, but each silently fixes some quirks and not others, so you discover the divergences empirically. vernier takes a third path:

  • Auditable parity. Every divergence from pycocotools is filed in the quirks survey under ADR-0002 as either strict (bit-equal output, even when vernier's implementation is structurally different) or corrected (opt-in opinionated fix). Strict is the default; corrected fixes are itemized so you always know when your numbers diverge from a reference run. A drop-in shim (vernier.patch_pycocotools()) keeps existing pycocotools-based scripts working with one line.
  • Rust core, Python frontend. The matching kernel is pure Rust with runtime SIMD dispatch; the FFI layer is data conversion only. The CLI ships as a static binary, so CI pipelines call vernier without provisioning a Python interpreter.
  • One toolkit instead of five. bbox / segm / boundary / keypoints AP, panoptic PQ, semantic mIoU, LVIS federated, oLRP error decomposition, and detection-family calibration all live behind one Python API and one CLI — folded over a single matching pass. Per-paradigm migration guides under docs/migrate/ show how to replace pycocotools, faster-coco-eval, panopticapi, lvis-api, and mmsegmentation one at a time.
  • Scenario slicing + cross-run aggregation. A partition manifest (weather, time_of_day, …) feeds vernier eval --manifest for per-slice headline metrics and vernier aggregate for cross-run corruption tables (mPC / rPC) — one matching pass, N slices (ADR-0046).

Per-paradigm parity status:

Paradigm / metric Oracle Parity tier Open caveat
Instance bbox / segm / keypoints AP pycocotools==2.0.11 strict bit-equal none
Instance boundary IoU boundary-iou-api strict bit-equal none
Segm + boundary TIDE thresholds (t_b) none yet corrected-only ADR-0022 still proposed; defaults extrapolated, not measured
Panoptic PQ panopticapi (single-core path) strict bit-equal none
Panoptic boundary PQ bowenc0221/boundary-iou-api (single-core path, same SHA as the instance vendor) strict bit-equal ADR-0025 §Z1/Z2 amendment; Cityscapes panoptic (Z3) deferred
Semantic mIoU / FWIoU / pAcc / mAcc mmseg.IoUMetric vendored at v1.2.2 (ADR-0036, still proposed); cityscapesScripts + ADE20K cross-impl bench externally blocked strict bit-equal on the four per-class u64 marginals at val2017 scale ADR-0028; ADE20K-scale bench gated on license-cleared cache
LVIS federated AP lvis-api (vendored at 031ac21f, ORACLE_LVIS_COMMIT_SHA) strict bit-equal on the (T, R, K, A) precision tensor at full LVIS v1 val bench paradigm wired; segm cell waits on evaluate_segm_grid_with_dataset
LRP / oLRP error decomposition (instance bbox / segm / boundary / keypoints) pure-NumPy oracle (ADR-0043) strict against the oracle within 1e-9; kemaloksuz/LRP-Error tripwire vendored opt-in panoptic LRP is a typed NotImplementedError stub — panoptic predictions carry no per-segment scores (ADR follow-up)
Detection-family calibration — ECE / MCE / reliability (instance bbox / segm / boundary / keypoints) clean-room NumPy oracle (ADR-0018) with isolated P1–P10 quirks survey strict bit-equal against the oracle (16/16 parity tests) panoptic (Shape 2) and semantic (Shape 3) calibration deferred on data-model prerequisites; Clopper-Pearson CI documented Phase-2

Three-tier parity model: ADR-0002; per-library comparison: docs/comparison.md.

Three evaluation paradigms

They have different data models, different matching rules, and different parity oracles:

  • vernier.instance — detections with scores → bbox / segm / boundary / keypoints AP.
  • vernier.panoptic — RGB-encoded panoptic PNGs + segments_info JSON → PQ.
  • vernier.semantic — single-channel class-id label maps → mIoU / FWIoU / pAcc / mAcc.

See Three paradigms.

Documentation

Contributing

Local checks: just lint && just test && just audit. The full contributor workflow (ADR lifecycle, vendoring policy, code style) is in CONTRIBUTING.md. Repository layout and common just recipes are in CLAUDE.md.

License

Dual-licensed under Apache-2.0 or MIT at your option.

Third-party code

vernier vendors a small number of test-only reference implementations to support parity testing. None of this code is included in published wheels or linked into the Rust binary. See THIRD_PARTY_NOTICES.md for the full inventory and license attributions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vernier-0.0.3.tar.gz (627.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vernier-0.0.3-cp310-abi3-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.10+Windows x86-64

vernier-0.0.3-cp310-abi3-musllinux_1_2_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

vernier-0.0.3-cp310-abi3-musllinux_1_2_aarch64.whl (2.0 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

vernier-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

vernier-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

vernier-0.0.3-cp310-abi3-macosx_11_0_arm64.whl (1.7 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

vernier-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file vernier-0.0.3.tar.gz.

File metadata

  • Download URL: vernier-0.0.3.tar.gz
  • Upload date:
  • Size: 627.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vernier-0.0.3.tar.gz
Algorithm Hash digest
SHA256 d0fac8b8d6e824b5e8945f9f55a34120c30ae3e5fdf0c813c4dbcd88c1b6b3b5
MD5 df4f0f066068334db9365b2882f53277
BLAKE2b-256 7b88b52e381022fe3611f98d1cba1f925ca65fb518abd0c85b1783cfdc578f7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3.tar.gz:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: vernier-0.0.3-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.10+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vernier-0.0.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b9d0ba12c2f4f9cddb334b2816bc270ed26ce4e4eb6f605b648e7653911f6b51
MD5 0b670756670b9dac2daa64156b0d4edb
BLAKE2b-256 cf2c6395a270491dae96c43c1750331128fed7a1bd2d23718dc0c9e48354fd75

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-win_amd64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1b696f5c20e7dc921c8738564c7694c9f15dbe6d0f5af0e556ee15697cfd784
MD5 2c01273d034f300bc584ffc8666ce9b8
BLAKE2b-256 8148bd62de5978ee47591ea00e8a6fdf25ed992a34db43f6d2be57e4aafdea9a

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e71df1873658c771b044f866772ac24790cbc15cb1e0ef8eac417724a577f162
MD5 4af32e7bc2254a0b0ba36a1350cc2815
BLAKE2b-256 f2b475ef69746ffb512645d515ccb429dc7369ed276e2942aef85b43ba38d0e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1c2086e8a5bd71cb11fc9d953ff7eae964e37fe1cf2f7f2c8fa9e2b81609cfe1
MD5 cbac6329375ab7993cb22fdbbc1f3feb
BLAKE2b-256 ec296150d5585c0d0cc0555400359e92e1e6aa20f5ae76768c442d88cba4835c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a77b51398b27218e69a2fc8065874677315ec419054fe47c6a617c6ad0111625
MD5 fc9e4e245f7d4f62b12be708e0275985
BLAKE2b-256 cd496f02b0814dcb11c692b353ea0b536abecff54954c17024ab39a591519cc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9051fc25fb2016ec6969794f0a1e43473bd84a81b5c30f53292abd3da30b51f1
MD5 b7c1c26a987b64c5b33a20022b25d3f6
BLAKE2b-256 ab41ce23f51515debd204ef3e9adfcdbe268f4353cce9cc7f5f8b4059e4234f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vernier-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 989f9fe1f4bad6fd7880d761d266f19ea4cdcf5e809d04d0df4779658cd80e75
MD5 dcf92b2777d0d6f192db8a4dbf8be739
BLAKE2b-256 452e6053b3fc2a3c749284873b990875d30b0ad947708f1304821c8197b33a3b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.3-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: wheels.yml on NoeFontana/vernier

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page