Tennis court keypoint model (mirror)
Not trained by me. Mirrored from the abdullahtarek/tennis_analysis baseline so my pipeline's weights live in one place. Credit for the model and its training belongs to the original author.
What it is
A ResNet-based regressor that predicts the 14 tennis court landmarks - doubles corners, singles corners, service line intersections, centre marks - from a single frame. Fitting a homography to those gives an image-to-court mapping in metres.
The thing to know before you trust it
Its reprojection error is not a measure of accuracy. Reprojection asks only whether one homography explains the model's own 14 points, so a model that mislocates all 14 in a mutually consistent way scores perfectly.
Measured on two clips: reprojection held steady at ~0.77 px while the corners sat a median 14 px and 68 px from the actual painted lines, once as far as 129 px. The two numbers are uncorrelated.
Fix, which needs no retraining: take this model as an initial guess, then optimise the homography so the projected court lines land on detected line pixels in the frame. Held out on lines the fit never saw, that took the worst corner from 14 px to 3.6 px, and from 68 px to 7.6 px.