How fdilmr/ml-football-analysis works
• Video Input & I/O: Represent the main entry point (main.py) which triggers the pipeline, along with video file sources and output (see examples/output.avi). Also capture FFmpeg-based processing under “utils/video_utils.py”.
• Object Detection & Inference: Include the “inference” folder where multiple YOLO-based Python scripts (yolo_inference.py, roboflow_inference.py, etc.) reside, indicating detection of players, ball, and referees. Note that this component leverages pre-trained YOLOv11 models via Ultralytics.
• camera_movement_estimator (for camera or frame movement estimation)
• trackers (for tracking objects across frames)
• speed_and_distance_estimator (for calculating the speed and distance metrics)
• Assignment & Analysis: Highlight components such as:
• player_ball_assigner (for ball possession and player-ball interactions)
• view_transformer (if used for perspective corrections or view-based modifications)
• Supporting Utilities & Data Handling: Represent the “utils” folder with utility modules (bbox_utils.py, video_utils.py) and note common libraries like OpenCV, NumPy, Pandas, and Matplotlib that aid in data manipulation and frame annotation.
• Training & Experimentation: Show a sub-component for model training and experiments (under the “training” folder and notebooks) that provides evaluation feedback and further fine-tuning.
Relationships and Data Flow
• From Tracking, flow to the Analysis components: player position estimation, ball interpolation, speed & distance computation, team assignment, and ball possession detection.
Architectural Patterns and Design Principles
• Modular design – each analytical capability (e.g., speed estimation, team assignment) is implemented in its own module to promote separation of concerns and extensibility.
• That the pipeline follows a sequential data-processing pattern: input handling → detection → tracking → analysis → visualization.
• How configuration files and notebooks (such as in “development_and_analysis” and “notebooks”) might be used to experiment and tune parameters outside of the core production pipeline.
Technologies, Frameworks, or Libraries
• Use of deep learning frameworks (PyTorch for training/inference).
• OpenCV for video processing and FFmpeg for input/output handling.
• Use YOLOv11 (via Ultralytics and Roboflow) in the detection module.
• Reference peripheral libraries like NumPy, Pandas, and Matplotlib that enable calculations and visualization.