Skip to main content

cvconform
the correctness and reliability layer for computer vision

Python Platform License


Computer vision has a hidden reliability crisis. A model is trained once (PyTorch, CUDA, FP32) and then silently transformed — ONNX, TensorRT, CoreML, OpenVINO, TFLite, quantization, operator fusion. Every transformation creates opportunities for the model to stop being itself.

The industry mostly asks "Can this model run?"

cvconform answers the question nobody was asking: "Is this still the same model?" It is differential conformance verification for vision models — execute the same model on multiple runtimes with the same seeded inputs, compare the outputs, and when they differ, know exactly why.

✨ Zero config

cvconform works on a fresh clone with no configuration.

pip install cvconform
cd your-model-repo

cvconform init      # auto-detects your model + contract, writes .cvconform.yaml
cvconform verify    # auto-runs every installed runtime, prints a conform report

It auto-discovers model format (torchscript, onnx, coreml, tflite, tensorrt engine, mlx, openvino), input shape, output names, and a calibration set — from the artifact itself or a registry of known architectures (yolo, sam, detr, resnet, vit, clip, unet, pose, ocr, …), with a sensible heuristic fallback.

Friction demo — measured time to first green check

cvconform init + bare cvconform verify --targets onnx on three fresh repos (Apple M4):

Family Model Time Result
Detection yolov8n.pt 2.3s ONNX 100%
Segmentation unet_seg.pt 4.6s ONNX 100%
Classification resnet18.pt 1.4s ONNX 100%

Install

pip install cvconform                # core: numpy, onnx, onnxruntime, pyyaml
pip install 'cvconform[pytorch]'     # PyTorch reference backend
pip install 'cvconform[coreml]'      # CoreML target (macOS)
pip install 'cvconform[openvino]'    # OpenVINO target
pip install 'cvconform[all]'         # every optional backend

Requires Python 3.10+. On Apple Silicon you get CoreML + MLX paths for free.

Usage

Python API

from cvconform import verify

result = verify(
    model="yolo11.pt",
    reference="pytorch",
    targets=["onnx", "coreml"],
    seed=0,
)

CLI

# Clear a model — auto-discover everything else
cvconform verify

# Explicit
cvconform verify model.pt --reference pytorch --targets onnx,coreml

# Machine-readable report for CI/CD
cvconform verify model.pt --json report.json

# CI gate: non-zero exit if any runtime diverges
cvconform verify --require-conformant

# Pre-commit fast mode
cvconform verify --pre-commit

# Store findings in your regression-memory corpus
cvconform verify --corpus corpus/

Output

VISION CONFORM REPORT
Model:       yolo11.pt
Reference:   pytorch

CONFORMANCE SCORES
  onnx            100.00%
  coreml           96.36%

FINDINGS: none — all targets conformant within policy.

When a runtime does diverge, cvconform tells you why — not "probably a bug", but:

CRITICAL FINDING
Backend:       CoreML
Affected:      Conv+Activation fusion
Cause:         FP16 accumulation drift
Impact:        37 production images produce different classes
Confidence:    96%
Fixes:         1. Disable operator fusion
               2. Force FP32 accumulation
               3. Report upstream issue

Extras

Feature How
CI gate --require-conformant / --pre-commit exit non-zero on divergence
Pre-commit hook one-line install — see .pre-commit-hooks.yaml
GitHub Action composite action installs → verifies → comments a badge — see .github/actions/verify
Regression memory every failure becomes a permanent, versioned corpus entry
Failure discovery hunts for diverging inputs (noise, edges, illumination, blur, compression, extremes)
Failure reduction shrinks a failing image to a minimal repro

The science behind it

Every result is reproducible and evidence-driven:

  • seedable inputs → identical reports for identical seeds
  • recorded environment + exact backend versions
  • evidence objects: observed X at node Y, magnitude Z, likely mechanism M, confidence C%
  • a permanent regression corpus so cvconform gets smarter about how vision models fail in the real world

What "conformance" means (and doesn't)

cvconform verifies deployment conformance: that a compiled artifact (ONNX, CoreML, …) still behaves like your reference model. It answers "is this still the same model?", not "is this model accurate?".

  • accurate-but-broken-by-export → detected
  • inaccurate-but-faithfully-exported → conformant (that's a calibration problem, out of scope here)

Architecture

loaders/    framework -> VisionGraph IR
ir/         VisionGraph, operators, precision, passes, registry
autodetect/ zero-config model + calibration discovery
config/     .cvconform.yaml read/write
runtimes/   versioned wrappers (onnxruntime, pytorch, coreml, ...)
engines/    differential, comparison, analyze (root cause)
discovery/  input generation + expedition
reduce/     failing-input minimization
corpus/     regression memory
research/   AI research agent
report/     human + JSON conformance reports
cli.py      init / verify / discover

Development

uv venv --python 3.12 .venv
source .venv/bin/activate
python -m pytest

Typed Python with dataclasses, conventional commits, a green pytest run before any PR. See docs/report-schema.md for the machine-readable CI contract and CHANGELOG.md for release history.

License

MIT © David Nichols

Release files for cvconform 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvconform 0.1.1
File Size Uploaded
cvconform-0.1.1.tar.gz 60.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cvconform 0.1.1
File Interpreter ABI Platform
cvconform-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 119.3 kB

Release files / cvconform-0.1.1.tar.gz

Download URL cvconform-0.1.1.tar.gz
Size 60.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6b562f4cfb117f24dd326abc6f72e7e238caf1d96369de23429ee8ef9921c2ec
BLAKE2b-256 checksum
How to use checksums
a4e7664f09523861c13f54a69fd9b7f656172feaa59dfdcf73213c30a86476a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / cvconform-0.1.1-py3-none-any.whl

Download URL cvconform-0.1.1-py3-none-any.whl
Size 59.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9fab533f0773b742311395f36952641a13de55cb972f26b3f060949694a4e3d
BLAKE2b-256 checksum
How to use checksums
d81a107e34dea506734222547bc2ac36e94acf923acb43e3a5955cf9f0202dd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

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