Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

yastrebksv/TennisProject patches

Phase 1 of this pipeline runs a patched fork of yastrebksv/TennisProject (ball, court, person, bounce detection) on Colab GPU. The upstream repo currently has no LICENSE file, so we don't redistribute the source here. Instead, this directory contains the patches we apply on top of upstream commit b7552e9.

What's patched

File Why
main.py Adds --path_upstream_artifact flag that dumps upstream.npz (ball track, homographies, court keypoints, per-frame person detections, bounces, scenes, fps, sha256). This is the contract between Phase 1 and Phase 2. Also adds player-track smoothing (max-jump rejection + carry-forward), static-camera homography stabilization, and a lazy frame reader to avoid OOM on long clips.
person_detector.py Faster R-CNN ResNet50 → YOLOv8x for far-player recall on broadcast (where the camera-far player is small). Interface preserved.
ball_detector.py Per-axis coordinate scaling for non-360p inputs (the upstream code assumed a fixed model input).
court_detection_net.py Scene-aware sparse inference: ~1 sample/sec per scene instead of every frame. Replays / tight shots get None homography downstream.
homography.py One-line numpy 2.0 fix (np.Infnp.inf).

How to reproduce

# 1. Clone upstream at the pinned SHA.
git clone https://github.com/yastrebksv/TennisProject /tmp/TennisProject
cd /tmp/TennisProject
git checkout b7552e955253c008c7612298cb40694682a74ef9

# 2. Apply the patches.
git apply <path-to-this-repo>/third_party/yastrebksv_TennisProject_patches/all.patch

# 3. Place the patched directory at third_party/yastrebksv_TennisProject/
#    in this repo (path the Phase-1 Colab notebook expects).

The Colab notebook (scripts/colab_run.ipynb) embeds the patched main.py and person_detector.py directly via %%writefile cells, so the Colab path doesn't require this local clone. These patches exist for users who want to run Phase 1 outside Colab or to inspect the changes.

Upstream license

yastrebksv/TennisProject does not currently include a LICENSE file. We use these patches under fair-use research framing and do not redistribute the upstream source. If you fork or build on this project, treat the upstream code as "all rights reserved" until the original author publishes a license.