Spaces:
Running
Running
Irpan
commited on
Commit
•
d8fc5c3
1
Parent(s):
90d7d51
ia
Browse files- app.py +3 -3
- requirements.txt +2 -1
app.py
CHANGED
@@ -11,7 +11,7 @@ from camera_movement_estimator import CameraMovementEstimator
|
|
11 |
from view_transformer import ViewTransformer
|
12 |
from speed_and_distance_estimator import SpeedAndDistance_Estimator
|
13 |
|
14 |
-
def process_video(input_video, player_stats, ball_stats):
|
15 |
print(input_video)
|
16 |
# Read Video
|
17 |
video_frames = read_video(input_video) # use the uploaded file
|
@@ -19,7 +19,7 @@ def process_video(input_video, player_stats, ball_stats):
|
|
19 |
# Initialize Tracker
|
20 |
tracker = Tracker('models/best.pt')
|
21 |
|
22 |
-
if input_video
|
23 |
print("loading cached tracks")
|
24 |
tracks = tracker.get_object_tracks(video_frames,
|
25 |
read_from_stub=True,
|
@@ -35,7 +35,7 @@ def process_video(input_video, player_stats, ball_stats):
|
|
35 |
|
36 |
# Camera movement estimator
|
37 |
camera_movement_estimator = CameraMovementEstimator(video_frames[0])
|
38 |
-
if input_video
|
39 |
print("loading cached camera movements")
|
40 |
camera_movement_per_frame = camera_movement_estimator.get_camera_movement(video_frames,
|
41 |
read_from_stub=True,
|
|
|
11 |
from view_transformer import ViewTransformer
|
12 |
from speed_and_distance_estimator import SpeedAndDistance_Estimator
|
13 |
|
14 |
+
def process_video(input_video, player_stats=True, ball_stats=True):
|
15 |
print(input_video)
|
16 |
# Read Video
|
17 |
video_frames = read_video(input_video) # use the uploaded file
|
|
|
19 |
# Initialize Tracker
|
20 |
tracker = Tracker('models/best.pt')
|
21 |
|
22 |
+
if input_video.contains("121364_0_small.mp4"):
|
23 |
print("loading cached tracks")
|
24 |
tracks = tracker.get_object_tracks(video_frames,
|
25 |
read_from_stub=True,
|
|
|
35 |
|
36 |
# Camera movement estimator
|
37 |
camera_movement_estimator = CameraMovementEstimator(video_frames[0])
|
38 |
+
if input_video.contains("121364_0_small.mp4"):
|
39 |
print("loading cached camera movements")
|
40 |
camera_movement_per_frame = camera_movement_estimator.get_camera_movement(video_frames,
|
41 |
read_from_stub=True,
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
opencv-contrib-python==4.10.0.84
|
2 |
opencv-python==4.10.0.84
|
3 |
opencv-python-headless==4.10.0.84
|
@@ -10,4 +11,4 @@ matplotlib==3.8.0
|
|
10 |
matplotlib-inline==0.1.7
|
11 |
matplotlib-venn==1.1.1
|
12 |
pandas==2.2.2
|
13 |
-
sklearn-pandas==2.2.0
|
|
|
1 |
+
gradio==2.9.1
|
2 |
opencv-contrib-python==4.10.0.84
|
3 |
opencv-python==4.10.0.84
|
4 |
opencv-python-headless==4.10.0.84
|
|
|
11 |
matplotlib-inline==0.1.7
|
12 |
matplotlib-venn==1.1.1
|
13 |
pandas==2.2.2
|
14 |
+
sklearn-pandas==2.2.0
|