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, and LVIS federated. Rust core, Python frontend, optional CLI.

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.
  • One toolkit instead of five. bbox / segm / boundary / keypoints AP, panoptic PQ, semantic mIoU, and LVIS federated all live behind one Python API and one CLI. Per-paradigm migration guides under docs/migrate/ show how to replace pycocotools, faster-coco-eval, panopticapi, lvis-api, and mmsegmentation one at a time.
  • 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.

Status & validation

Pre-1.0; public API is unstable. See docs/adr/ for the design decisions shaping it. 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 boundary=True raises NotImplementedError (ADR-0025 §Q3)
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

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

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.

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 next training step. The matching kernel runs on a worker thread, so submit(...) returns immediately and the training 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.

Three evaluation paradigms

Pick the submodule whose input shape matches your model's output — 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 for when to use which.

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.2.tar.gz (497.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.2-cp310-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.10+Windows x86-64

vernier-0.0.2-cp310-abi3-musllinux_1_2_x86_64.whl (1.7 MB view details)

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

vernier-0.0.2-cp310-abi3-musllinux_1_2_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

vernier-0.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

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

vernier-0.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

vernier-0.0.2-cp310-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

vernier-0.0.2-cp310-abi3-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: vernier-0.0.2.tar.gz
  • Upload date:
  • Size: 497.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.2.tar.gz
Algorithm Hash digest
SHA256 03e21adad5d4c1f45333cb82b43ac5c94b2f8593487574db9965e4a5393d27d1
MD5 8954711f7a3322ea69c797c1a2a91775
BLAKE2b-256 2f78789368661e3af24eadfd19dd3dd69a4666bc37aa81c88b7ebdf675223df0

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2.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.2-cp310-abi3-win_amd64.whl.

File metadata

  • Download URL: vernier-0.0.2-cp310-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.5 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.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1ebb55e2902e79dbfe8c8c00bff79cf1538259d9f476dd4509b688104578dc44
MD5 992f9a8ef308d0f1a9df783ae9b85fba
BLAKE2b-256 7ed7cac5ab3fcc5107a9b7ae2b97c0ecf970601dfbdaf399dcc06722f86a479b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6b4a6378a0acb81472c19f84e7f16f434ef0ad38a66b296ed95512dd0e5be602
MD5 00c452cda3c7f5b9bf00b09d2052acd0
BLAKE2b-256 d1363d6dba6054c7b513c094d5ac5e2d2aca0d92827667b3a6540f077b72a033

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fd414e420e682192a4d5268e91f51e8296faefc50fcece1bacd3d703d66af6a7
MD5 43beeb118ab80dcdda536d2516b05db0
BLAKE2b-256 db9991be0c89bd01eddafe714f0fcd9fbd0167a6607c5454e6c494316158709f

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8962943c5edfb38df27354e5527421dba3595a8697214c6d1a8bccd8f7f9efdb
MD5 838d36ba3a6d9be93d54468fb26c1ff6
BLAKE2b-256 635ff1e9029309342b6e3f96db5fd9ae882cded42f773f26129648c6a7808554

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c5e39132bfaa079614432d61fbb95c193b8b16006786f58a7ab1cb4703b41d68
MD5 9e37e1315bf3a74812ee0b98f661423c
BLAKE2b-256 693d7a6b10b983246bbb9111110c2121ea6b8a17b84e038f8abaaa3c9a43200e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e38d4b6987bb49a5343dfbe308edfcf57b09732a55d74446479c500d7e8012dd
MD5 c2ac4a865a49b7b3fcd67295d65d93ed
BLAKE2b-256 e49ebabe2a947bf69532a18be2e16ba1885df37817709fe8e97cd91102c64bf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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.2-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vernier-0.0.2-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0aa50bb710daff805ccfdb605f4c709de4127b3508e77c0cce566abae4e52379
MD5 346f1966ef5fb6c787f90f5b1854bd3a
BLAKE2b-256 831eff1dca32c0c883fedee306dc843ecfafe9893ae93fb1fb9a4a1100bdcbeb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vernier-0.0.2-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