About this project

This repository provides a fast pipeline for volleyball ball detection, rally extraction, and automatic generation of vertical 9:16 reels. It is designed for sports analytics and computer vision research, with real-time ball tracking on CPU hardware. The pipeline consists of several stages: ball detection from video using an optimized ONNX model, which writes ball coordinates to CSV and optionally produces an annotated video; conversion of the CSV into rally tracks as JSON; creation of a combined horizontal rally video or split rally clips; and generation of vertical reels centered on the ball trajectory. A court-aware variant can also use player detections to identify ball touches and distinguish rallies from balls handed over for the next serve. Installation uses uv sync, and the base install supports visualization since opencv-python includes a GUI backend. A dev extra adds matplotlib and pytest for diagnostics and tests. The quick-start workflow runs detection, track calculation, optional combined video processing, and reel creation through separate scripts. Key command-line options control confidence thresholds, visualization, CSV-only output, court annotation, tracking parameters, rally filtering, padding, and reel smoothing or interpolation. An interactive review script allows stepping through frames and tracks with keyboard controls. OpenVINO runtime scripts are also provided, including a player-and-ball detection script that outputs predictions JSON and annotated video. Available ONNX models are benchmarked on a CPU setup with reported F1, precision, recall, and inference FPS; the fastest model reaches over 1000 FPS in isolated inference, while a full pipeline run is slower due to shared video decoding. Earlier checkpoints are kept for reference.