Living Research Repo · v1 Tennis

Where Is The Ball?

Feeding a causal ball tracker its own previous prediction as a glowing 10th input channel — and training it on its own mistakes via scheduled sampling.

Vinay · MIT License
117.1 px
Hint-SS 14-condition mean error (vs. 151.9 px TrackNetV2, 138.7 px No-Hint)
8 / 14 Wins
Significantly beats TrackNetV2 (Holm p < 0.05) with 0 losses; 14/14 vs. Hint-TF
6× Smoother
38.1 px/f² degraded jitter vs. 232.3 px/f² for TrackNetV2 — no LSTM needed
Honest Caveat
TrackNetV2 keeps higher Acc@10 (24.5% vs. 18.2%) when it sees the ball; Hint-SS prevents catastrophic misses

Interactive Closed-Loop Rally Explorer

Fixed median-error test clip (#3, zero cherry-picking). Switch corruptions, scrub frame by frame, and watch the 10th hint channel guide the detector.
Frame 135
10th Channel: Self-Hint (t−1 → t) vis=1.00
Predicted Heatmap P(x, y | t) peak=--%
Frame-by-Frame Tracking Error (px at 1280×720, click anywhere to jump) Clip avg —

14-Condition Benchmark Explorer

Mean over 3 seeds on TrackNet tennis test games (21 clips). Click any condition or switch metrics to inspect trade-offs honestly.

The Whole Trick in 12 Lines of PyTorch

No LSTM. Zero-initialized 10th input channel. Linear scheduled sampling.
for t in range(T):
    # 1. Render previous prediction (or GT early in training) as a Gaussian hint blob
    px, py, pv = prev[:, 0:1, None] * W, prev[:, 1:2, None] * H, prev[:, 2:3, None].clamp(0, 1)
    hint = torch.exp(-((xx - px) ** 2 + (yy - py) ** 2) / (2 * sigma_px ** 2)) * pv

    # 2. Concatenate [frame_{t-2}, frame_{t-1}, frame_t, hint] -> 10-channel ResNet-18 U-Net
    coords, logits, feat = encoder(torch.cat([frames_3[:, t], hint[:, None]], dim=1))
    pred = refine(coords, feat)

    # 3. Scheduled sampling: decay p linearly 1 -> 0 over first 75% of training
    use_gt = (torch.rand(B, 1, device=x.device) < p).float() if training else 0.0
    prev = use_gt * gt[:, t] + (1.0 - use_gt) * pred

Citation

@misc{vinay2026whereistheball,
  title  = {Where Was the Ball? Feeding a Tracker Its Own Predictions in Degraded Video},
  author = {Vinay},
  year   = {2026},
  url    = {https://github.com/v1nayh3g/where-is-the-ball}
}