Irpan commited on
Commit
376c248
·
1 Parent(s): ac40841
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -88,7 +88,7 @@ def process_video(input_video, player_stats=True, ball_stats=True):
88
  speed_and_distance_estimator.draw_speed_and_distance(output_video_frames, tracks)
89
 
90
  # Save output video
91
- output_path = 'output_videos/output_video.mp4'
92
  save_video(output_video_frames, output_path)
93
 
94
  return output_path
@@ -97,13 +97,14 @@ def process_video(input_video, player_stats=True, ball_stats=True):
97
  title="Football Match Analytics with YOLO and OpenCV"
98
  description="""
99
  This tool processes football game videos to detect players and referees, track the ball, assign players to teams using color pixel clustering, and compute ball possession.
 
100
  It also estimates camera movement with Optical Flow, applies perspective transformation for scene depth, and calculates real-time speed and total distance traveled by each player and the ball.
101
 
102
  The YOLO model was fine-tuned with https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc
103
 
104
  Original Reference: https://www.youtube.com/watch?v=neBZ6huolkg
105
 
106
- **Note**: the space is running on CPU, so inferencing new video may take a long time (avg speed in test: 1.5min processing per 1 sec of video)"""
107
 
108
  examples = [["input_videos/121364_0_small.mp4", True, True]]
109
 
 
88
  speed_and_distance_estimator.draw_speed_and_distance(output_video_frames, tracks)
89
 
90
  # Save output video
91
+ output_path = 'output_videos/output_video.avi'
92
  save_video(output_video_frames, output_path)
93
 
94
  return output_path
 
97
  title="Football Match Analytics with YOLO and OpenCV"
98
  description="""
99
  This tool processes football game videos to detect players and referees, track the ball, assign players to teams using color pixel clustering, and compute ball possession.
100
+
101
  It also estimates camera movement with Optical Flow, applies perspective transformation for scene depth, and calculates real-time speed and total distance traveled by each player and the ball.
102
 
103
  The YOLO model was fine-tuned with https://universe.roboflow.com/roboflow-jvuqo/football-players-detection-3zvbc
104
 
105
  Original Reference: https://www.youtube.com/watch?v=neBZ6huolkg
106
 
107
+ **Note**: the space is running on CPU, so inferencing new video may take a bit of time. (Avg time during test: 1min processing per 5 second of video)"""
108
 
109
  examples = [["input_videos/121364_0_small.mp4", True, True]]
110