synthetic bool | profile string | effective_threshold_m float64 | calibration_error_m float64 | calibration_grade string | n_scenarios int64 | headline dict | noise_curve list | per_case list |
|---|---|---|---|---|---|---|---|---|
true | FIA F1 2024 (strict) | 1.8 | 0.4779 | B | 12 | {
"noise_px": 0,
"precision": 1,
"recall": 1,
"f1": 1,
"accuracy": 1,
"mean_abs_depth_error_m": 0.034,
"tp": 5,
"fp": 0,
"fn": 0,
"tn": 7
} | [
{
"noise_px": 0,
"precision": 1,
"recall": 1,
"f1": 1,
"accuracy": 1,
"mean_abs_depth_error_m": 0.034,
"tp": 5,
"fp": 0,
"fn": 0,
"tn": 7
},
{
"noise_px": 1,
"precision": 1,
"recall": 1,
"f1": 1,
"accuracy": 1,
"mean_abs_depth_error_m": 0.061,
... | [
{
"scenario": "clear excursion",
"true_peak_over_m": 3.2,
"ground_truth": "VIOLATION",
"measured_depth_m": 3.215,
"P(violation)": 0.998,
"predicted": "VIOLATION",
"correct": true
},
{
"scenario": "clear excursion",
"true_peak_over_m": 2.8,
"ground_truth": "VIOLATION",
... |
π Apex Verdict β Track Limits Intelligence for Race Control
Probabilistic track-limit verdicts with metre-scale error bounds. Resolves the clear-cut cases automatically and hands stewards a ranked queue of only the genuinely ambiguous ones.
The problem
Stewards are the bottleneck in track-limits adjudication, and full automation is
unacceptable because a wrong call decides championships. Existing automation
outputs a binary VIOLATION / CLEAR flag with no error bound β so stewards
cannot tell a 3-metre excursion from a 3-centimetre one, do not know when the
system is guessing, and re-review everything anyway. The automation adds work.
The approach
Apex Verdict quantifies its own uncertainty. Every incident carries a probability, a Β±Ο in metres, and the decomposition of that Ο, so the system can be trusted exactly as far as its geometry allows β and no further.
video β MOG2 detection β click-to-calibrate homography β contact patch in METRES
β signed distance from boundary β regulation profile β Ο in quadrature
β P(violation) = 1 β Ξ¦(threshold; depth, Ο)
β AUTO-CLEAR / HUMAN REVIEW / AUTO-FLAG
No training. No GPU. No model weights. Classical CV and real geometry, running on a free CPU tier.
What makes it different
1 Β· Probabilistic verdicts, not binary flags.
Every output is P(violation) with Β±Ο in metres and a component breakdown β
calibration error, detection jitter, contact-patch approximation, detection
instability β so a steward can see why the system is unsure.
2 Β· Automated triage with a workload-reduction metric.
P > 0.90 auto-flags. P < 0.10 auto-clears. Everything between goes to a
steward, ranked most-ambiguous-first. The dashboard reports how many incidents
never needed a human, and roughly how many steward-minutes that saved. On the
bundled example: 3 candidates, 67 % resolved automatically, 1 routed to a
steward.
3 Β· Real-world geometry via click-to-calibrate homography. Four clicks on a track-surface rectangle plus one known distance gives decisions in metres, not pixels. Survives camera-angle changes that break every pixel-threshold approach. The residual of that fit is not discarded β it becomes the first term in the uncertainty budget.
4 Β· Measured accuracy from a synthetic ground-truth harness. Real precision/recall numbers, reproducible in-app (Tab 4), plus a degradation curve under injected detection noise that shows the uncertainty model is calibrated rather than decorative.
5 Β· Regulation profiles as configuration. Four ship by default β strict FIA F1, permissive club racing, wet-weather extended limits, high-sensitivity screening. Different series, different rules, zero code change. "All four wheels beyond the line" is modelled honestly as a one-car-width margin on the outer wheel's measured position.
6 Β· Counterfactual rule replay. See the same geometry judged under every rule set at once, instantly, with no reprocessing. Answers "would this have been a penalty in the wet?" in one table.
7 Β· Exportable evidence packets with a deterministic audit hash.
Every incident exports raw geometry, calibration parameters, the rule set
applied, the probability and the full uncertainty breakdown β plus a SHA-256
audit_hash over all of it. Same inputs always produce the same hash, so a
verdict is reproducible at appeal. CSV export alongside for existing race-control
tooling.
8 Β· Flip-point sensitivity. Each ambiguous incident reports the Ο that would be needed to resolve it automatically β telling stewards exactly what better evidence would buy them.
9 Β· Calibration trust gate β it fails safe. Calibration is graded A / B / C from its metre-space error. Grade C disables automated resolution entirely: if the geometry cannot be trusted, nothing is closed without a human. This is the direct answer to "without losing human accuracy".
Measured accuracy (synthetic ground truth)
12 authored passes β clear excursions, deliberate grazers on the decision boundary, and clean laps β rendered through the inverse homography into camera-view frames, then run through the identical production pipeline.
| Detection noise (1Ο) | Precision | Recall | F1 | Mean depth error |
|---|---|---|---|---|
| 0 px | 1.00 | 1.00 | 1.00 | Β±0.034 m |
| 1 px | 1.00 | 1.00 | 1.00 | Β±0.061 m |
| 2 px | 0.83 | 1.00 | 0.91 | Β±0.103 m |
| 4 px | 0.83 | 1.00 | 0.91 | Β±0.229 m |
| 8 px | 0.63 | 1.00 | 0.77 | Β±0.534 m |
Recall holds at 1.00 throughout β degradation shows up as false positives routed to a human, never as missed violations. That is the correct failure direction for race control.
β οΈ These are synthetic clips, not real broadcast footage. They measure the geometry, rule and triage stack under known ground truth. Real footage adds detection difficulty this harness does not model. We report it because a number you can reproduce beats a claim you cannot.
Try it
- Open the Space and press βΆ Load bundled example β calibration preset included, no upload needed.
- Press π Run analysis.
- On Verdicts, drag the confidence sliders and switch regulation profiles. The queue re-ranks and re-buckets instantly: triage is a pure function of already-computed geometry, so nothing is reprocessed.
- On Evidence, look at the bird's-eye panel β the shaded band around the car is Β±1Ο and Β±2Ο of true position. Export the packets.
- On Validation, re-run the harness against any profile.
To use your own clip: upload it (β€30 s analysed), click four corners of a rectangle lying flat on the track β kerb ends, marker boards, painted box corners β in the order near-left β near-right β far-right β far-left, enter its real width in metres, and set where the track-limit line sits.
Honest limitations
- Motion-based detection assumes a broadly static camera. Hard pans and cuts produce spurious blobs.
- No car identity or re-identification: overlapping cars can merge into one blob.
detection_confidencedrops when this happens, which widens Ο rather than silently producing a confident wrong answer β but it is a real limit. - The boundary is a straight polyline by default. Curved boundaries are supported by the geometry, but not yet by a drawing UI.
- The contact patch is a geometric approximation of the tyre footprint, not a wheel detector. Its Β±0.10 m is carried explicitly in the error budget.
- Calibration quality dominates the error budget in most clips. That is honest, and it is exactly why the trust gate exists.
- Decision support only. Every automatic closure is a policy choice the operator makes with the two threshold sliders, and every one is logged with the geometry behind it.
Repo map
| File | Role |
|---|---|
app.py |
Gradio UI β five tabs, all wiring and presentation |
detector.py |
MOG2 detection, track association, detection_confidence |
calibration.py |
Homography, metre conversion, calibration_error_m, trust grade |
violation.py |
Contact patch, signed distance, sustained-excursion detection |
confidence.py |
Error budget, P(violation), triage, workload, audit hash |
profiles.py |
Regulation profiles as configuration |
render.py |
Broadcast overlay, BEV uncertainty band, error-budget chart |
scene.py |
Synthetic camera-view renderer (shared by example + harness) |
validate.py |
Synthetic ground-truth harness, precision/recall/noise sweep |
make_example.py |
Regenerates the bundled one-click demo clip |
Run locally
pip install -r requirements.txt
python make_example.py # regenerate the bundled clip (optional)
python validate.py # regenerate the accuracy numbers (optional)
python app.py
The pitch
Stewards are the bottleneck, and full automation is unacceptable because a wrong call decides championships. Apex Verdict quantifies its own uncertainty, resolves the clear-cut majority automatically, and hands stewards a ranked queue of only the genuinely ambiguous cases β with the geometry and error bounds behind every verdict.
- Downloads last month
- 23