Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -340,10 +340,6 @@ def predict_video(video):
|
|
340 |
|
341 |
return results
|
342 |
|
343 |
-
import json
|
344 |
-
import numpy as np
|
345 |
-
import pandas as pd
|
346 |
-
|
347 |
def ComputeStatistics(df):
|
348 |
# Calculer les statistiques supplémentaires
|
349 |
goalConceeded = df['top1'].str.startswith("Goal_2").sum()
|
@@ -369,11 +365,11 @@ def ComputeStatistics(df):
|
|
369 |
|
370 |
# Calculer le temps du premier Goal_1
|
371 |
first_goal1_row = df[df['top1'].str.startswith("Goal_1")].iloc[0] if not df[df['top1'].str.startswith("Goal_1")].empty else None
|
372 |
-
timeFirstGoal1 = (1 / 30) * first_goal1_row['start_frame'] if first_goal1_row is not None else None
|
373 |
|
374 |
# Calculer le temps du premier Goal_2
|
375 |
first_goal2_row = df[df['top1'].str.startswith("Goal_2")].iloc[0] if not df[df['top1'].str.startswith("Goal_2")].empty else None
|
376 |
-
timeFirstGoal2 = (1 / 30) * first_goal2_row['start_frame'] if first_goal2_row is not None else None
|
377 |
|
378 |
# Calculer le taux de conversion
|
379 |
convertionRate1 = totalGoal1 / totalShots1 if totalShots1 > 0 else 0
|
@@ -422,3 +418,4 @@ def ComputeStatistics(df):
|
|
422 |
|
423 |
|
424 |
|
|
|
|
340 |
|
341 |
return results
|
342 |
|
|
|
|
|
|
|
|
|
343 |
def ComputeStatistics(df):
|
344 |
# Calculer les statistiques supplémentaires
|
345 |
goalConceeded = df['top1'].str.startswith("Goal_2").sum()
|
|
|
365 |
|
366 |
# Calculer le temps du premier Goal_1
|
367 |
first_goal1_row = df[df['top1'].str.startswith("Goal_1")].iloc[0] if not df[df['top1'].str.startswith("Goal_1")].empty else None
|
368 |
+
timeFirstGoal1 = (1 / 30) * first_goal1_row['start_frame'] if first_goal1_row is not None and 'start_frame' in first_goal1_row else None
|
369 |
|
370 |
# Calculer le temps du premier Goal_2
|
371 |
first_goal2_row = df[df['top1'].str.startswith("Goal_2")].iloc[0] if not df[df['top1'].str.startswith("Goal_2")].empty else None
|
372 |
+
timeFirstGoal2 = (1 / 30) * first_goal2_row['start_frame'] if first_goal2_row is not None and 'start_frame' in first_goal2_row else None
|
373 |
|
374 |
# Calculer le taux de conversion
|
375 |
convertionRate1 = totalGoal1 / totalShots1 if totalShots1 > 0 else 0
|
|
|
418 |
|
419 |
|
420 |
|
421 |
+
|