Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ def estimate_trajectory(ball_positions, frames, detection_frames):
|
|
92 |
filtered_frames = [detection_frames[0]]
|
93 |
for i in range(1, len(ball_positions)):
|
94 |
prev_pos = filtered_positions[-1]
|
95 |
-
curr_pos =
|
96 |
distance = np.sqrt((curr_pos[0] - prev_pos[0])**2 + (curr_pos[1] - prev_pos[1])**2)
|
97 |
if distance <= MAX_POSITION_JUMP:
|
98 |
filtered_positions.append(curr_pos)
|
@@ -194,7 +194,7 @@ def create_3d_plot(detections_3d, trajectory_3d, pitch_point_3d, impact_point_3d
|
|
194 |
]
|
195 |
|
196 |
pitch_scatter = go.Scatter3d(
|
197 |
-
x=[pitch_point_3d[0]]
|
198 |
y=[pitch_point_3d[1]] if pitch_point_3d else [],
|
199 |
z=[pitch_point_3d[2]] if pitch_point_3d else [],
|
200 |
mode='markers', marker=dict(size=8, color='red'), name='Pitch Point'
|
|
|
92 |
filtered_frames = [detection_frames[0]]
|
93 |
for i in range(1, len(ball_positions)):
|
94 |
prev_pos = filtered_positions[-1]
|
95 |
+
curr_pos = box_positions[i]
|
96 |
distance = np.sqrt((curr_pos[0] - prev_pos[0])**2 + (curr_pos[1] - prev_pos[1])**2)
|
97 |
if distance <= MAX_POSITION_JUMP:
|
98 |
filtered_positions.append(curr_pos)
|
|
|
194 |
]
|
195 |
|
196 |
pitch_scatter = go.Scatter3d(
|
197 |
+
x=[pitch_point_3d[0]] if pitch_point_3d else [],
|
198 |
y=[pitch_point_3d[1]] if pitch_point_3d else [],
|
199 |
z=[pitch_point_3d[2]] if pitch_point_3d else [],
|
200 |
mode='markers', marker=dict(size=8, color='red'), name='Pitch Point'
|