How shrimpstanot/football_analysis works
This is a video-based football match analysis application. A user-provided match video is loaded, then the main workflow detects and tracks players, referees, and the ball; estimates camera motion and field perspective; computes player speed and distance; assigns teams and ball possession; and renders an annotated output video. The graph separates these domain stages while retaining the shared bounding-box and video I/O layer. Some README capabilities, such as interpolation, are represented where documented or directly visible; implementation details beyond the supplied excerpts are not inferred.
Main entry points: main.py Analysis coordinator · video_utils.py Video I/O · bbox_utils.py Bounding-box utilities · tracker.py Detection and tracking
Components 16
Analysis workflow
- Analysis coordinator
main.py - Video I/O
utils/video_utils.py - Bounding-box utilities
utils/bbox_utils.py
Tracking and motion
- Detection and tracking
trackers/tracker.py - Track positions
trackers/tracker.py - Camera motion
camera_movement_estimator/camera_movement_estimator.py
Field metrics
- Perspective mapping
view_transformer/view_transformer.py - Speed and distance
speed_and_distance_estimator/speed_and_distance_estimator.py
Match context
- Team assignment
team_assigner/team_assigner.py - Ball possession
player_ball_assigner/player_ball_assigner.py
Video rendering
- Track annotations
trackers/tracker.py - Motion overlay
camera_movement_estimator/camera_movement_estimator.py - Metrics overlay
speed_and_distance_estimator/speed_and_distance_estimator.py
Other components
- Video analyst
- Match video
- Annotated video
Connections 20
- Video analyst → Match video: provides
README.md - Match video → Video I/O: read frames
utils/video_utils.py - Video I/O → Analysis coordinator: returns frames
main.py - Analysis coordinator → Detection and tracking: requests tracks
main.py - Detection and tracking → Track positions: adds positions
trackers/tracker.py - Analysis coordinator → Camera motion: estimates motion
main.py - Analysis coordinator → Perspective mapping: maps positions
main.py - Analysis coordinator → Speed and distance: calculates metrics
main.py - Analysis coordinator → Team assignment: assigns teams
main.py - Analysis coordinator → Ball possession: assigns possession
main.py - Analysis coordinator → Track annotations: draws tracks
main.py - Analysis coordinator → Motion overlay: draws motion
main.py - Analysis coordinator → Metrics overlay: draws metrics
main.py - Analysis coordinator → Video I/O: saves frames
main.py - Video I/O → Annotated video: writes video
utils/video_utils.py - Video analyst → Annotated video: receives result
README.md - Detection and tracking → Bounding-box utilities: uses geometry
trackers/tracker.py - Camera motion → Bounding-box utilities: measures movement
camera_movement_estimator/camera_movement_estimator.py - Speed and distance → Bounding-box utilities: measures distance
speed_and_distance_estimator/speed_and_distance_estimator.py - Ball possession → Bounding-box utilities: measures proximity
player_ball_assigner/player_ball_assigner.py