Demo -- read-only snapshot of the live system as of 2026-07-16T01:45:31Z; no live data, paper units only.
Skip to main content

evidence / Engineering depth

Broadcast Video to Court Coordinates on a Consumer GPU -- built from primitives

A complete computer-vision pipeline that turns NBA broadcast footage into per-player court coordinates and behavioral features, running on a single consumer RTX 4060, with the tracking math implemented from scratch rather than wrapped from a black box. The single truth-source for any figure below is docs/JOB_EVIDENCE_PACKET.md; this page states the honest capability and is explicit about what is NOT yet demonstrated.

strongest single receipt

Broadcast video comes in; court coordinates and behavioral features come out

the claim

Broadcast video comes in; court coordinates and behavioral features come out. The pipeline runs end-to-end on one consumer GPU (RTX 4060, 8GB) and writes per-track court positions plus behavioral fields to data/tracking_data.csv. What makes it an engineering artifact rather than a library demo is that the load-bearing pieces are built from primitives:

- Multi-object tracking from scratch. A 6D constant-velocity Kalman filter for motion prediction, and the Hungarian algorithm for globally-optimal frame-to-frame ID assignment over a blended IoU-plus-appearance cost, with a greedy fallback. Not a wrapped tracker. - A custom-trained ball detector. YOLOv8n fine-tuned to a single ball class, then exported across PyTorch, ONNX, and TensorRT for deployment. - Court homography from classical CV. HSV masking, HoughLinesP, line-intersection cornering, and getPerspectiveTransform recover the camera-to-court matrix per clip, with a static-matrix fallback and unit tests on synthetic courts. - Broadcast hardening. A SIFT three-tier strategy with inlier gating, EMA smoothing, drift re-anchoring, and replay/scene-cut suspension so player trajectories are not corrupted during graphics and replays. A two-frame confirmation gate is unit-tested. - OSNet re-ID reimplemented in PyTorch -- omni-scale blocks and depthwise-separable convolutions -- behind a layered inference backend (TensorRT to torchreid to standalone to MobileNetV2 to HSV histograms), so it runs whether or not the accelerated deps are present. - A feature layer hardened against silent corruption -- pixel-vs-feet auto-rescale, physical-validity caps, phantom-slot filtering, and roughly ten documented sentinel-leak fixes, each guard tied to a specific observed broadcast artifact.

The end result at scale: anonymous tracker slots resolved to real NBA player identities across 240-plus games -- 17,254 `cv_features` rows spanning 241 games and 252 distinct real NBA player IDs (counted directly from the local database this session).


receipts

claimreceiptcommitted artifact
End-to-end pipeline orchestrationcommittedsrc/pipeline/unified_pipeline.py
Kalman + Hungarian tracker from primitivescommittedsrc/tracking/advanced_tracker.py (_make_kf() / _assign())
Custom YOLOv8n ball-detector trainingcommittedscripts/train_ball_yolo.py
Court homography from classical CVcommittedsrc/tracking/court_detector.py
Homography unit tests (synthetic courts)committedtests/test_court_detector.py (7/7 pass)
Broadcast homography confirmation gatecommittedtests/test_homography_thresholds.py
OSNet re-ID reimplementation + backend chaincommitted (ImageNet weights -- see caveat)src/tracking/osnet_reid.py
Feature layer with sentinel-leak guardscommittedsrc/pipeline/tracking_feature_extractor.py
Ball-detector weights (PyTorch/ONNX/TensorRT)local-only (gitignored)models/weights/yolov8n_ball.{pt,onnx,engine}
Resolved identities at scalelocal-only (gitignored)data/nba_ai.db cv_features: 17,254 rows / 241 games / 252 player IDs

why this matters

Two things, and the second is the point. First, the CV engineering: implementing Kalman filtering, the Hungarian assignment, a classical-CV homography recovery, and an omni-scale re-ID architecture from primitives -- and hardening all of it against the silent-corruption failure modes broadcast footage is prone to -- is mid-level CV-engineer work done solo. Every guard in the feature layer traces to a specific broadcast artifact that was observed and diagnosed.

Second, the honesty discipline. The easy version of this page would claim a re-ID accuracy, a positional precision in inches, a ten-player frame rate, and a CV-feature edge. None survive scrutiny, so none appear here. The pipeline outputs court coordinates and resolves real player identities at real scale; the accuracy of those coordinates is not yet benchmarked against ground truth, and the CV features do not yet move the prediction model. Stating exactly that -- what works, and what is built-but-unproven -- is the same discipline that runs through the rest of this evidence layer.


reproduce

reproduce on a fresh clone
python -m pytest tests/test_court_detector.py -q
python -m pytest tests/test_homography_thresholds.py -q
no edge claimed

This site reports calibration and sharpness only, never a dollar edge, ROI, or bankroll result. An honest null is a success.