Skip to content

Moa1er/Football-Winners

Repository files navigation

Football-Winners : Football Analytics with Multi-Object Tracking and Cross-Camera Fusion

Project blog (HackMD)

Results

master_synced_tracking master_pitch_only


Poster

View the TU Delft Project Poster (PDF)


Python scripts in this repository

File Description Relation to the blog
homography-id-matching-and-2d-vizualisation/create_homography_and_field_registration.py Interactive tool for lens‑distortion correction and manual point‑correspondence selection to compute a planar homography for a single camera. Implements the Field Registration and Homography section of the blog (steps 1‑3).
homography-id-matching-and-2d-vizualisation/match_ids_and_create_final_2d_vizualisation.py Takes the per‑camera homographies, projects detections onto a shared field coordinate system, fuses IDs across cameras and renders the final 2‑D visualisation video. Realises the Cross‑Camera Fusion and Global ID Assignment part of the blog.
synchronization-and-bytetrack/yolo.py Wrapper that loads the fine‑tuned YOLO‑26 model and runs frame‑wise inference, outputting detections in YOLO format. Corresponds to the Object Detection model & Fine‑tuning step described in the blog.
synchronization-and-bytetrack/yolo_sahi.py Uses the SAHI library to perform sliced inference on high‑resolution frames, handling large images that do not fit in GPU memory. Provides an alternative inference method mentioned in the blog’s discussion of detection performance.
synchronization-and-bytetrack/oc-sort.py Reference implementation of the OC‑SORT tracker (alternative to ByteTrack). Mentioned in the blog when comparing tracking algorithms.
video-processing-scripts/run_pipeline.py Orchestrates the full pipeline: video synchronisation, detection, ByteTrack tracking, homography projection, cross‑camera fusion, ID management and statistics export. The Running the Pipeline command block in the blog ties all components together; this script is the entry point.
yolo-finetuning/test_model.py Simple sanity‑check script that loads the fine‑tuned YOLO weights and runs inference on a single image for debugging. Supports the Fine‑tuning results visualisations shown in the blog.
yolo-finetuning/test_model_sahi.py Demonstrates SAHI‑based sliced inference on a video, saving per‑frame YOLO‑format label files and an annotated output video. Extends the detection experiments discussed in the blog’s Object detection model & Fine‑tuning section.
compute-match-statistics/*/stats.ipynb Jupyter notebooks to compute and visualise aggregated metrics like distance, speed, possession, passes, pressure, and heat‑maps. Implements the statistical calculations and visualisations shown in the Computing Match Statistics section of the blog.

How the scripts fit together

  1. Synchronise the two raw videos (FPS normalisation, offset trimming) – performed manually or with a small helper script.
  2. Create homographies for each camera using create_homography_and_field_registration.py.
  3. Detect players and ball with yolo.py (or yolo_sahi.py for sliced inference).
  4. Track each camera separately using ByteTrack (invoked inside run_pipeline.py).
  5. Fuse the two camera streams and assign stable master IDs with match_ids_and_create_final_2d_vizualisation.py.
  6. Export statistics (distance, speed, passes, pressure) – run_pipeline.py writes CSV files under stats/.
  7. Visualise the results – the final 2‑D video and heat‑maps are generated by the visualisation step in run_pipeline.py.

For any questions, open an issue or contact us :).

About

Football Analytics with Multi-Object Tracking and Cross-Camera Fusion

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors