Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,8 +40,8 @@ AG_REPO_ID = "emkessle/2024-24679-fencing-touch-predictor"
|
|
| 40 |
AG_ZIP_NAME = "autogluon_predictor_dir.zip"
|
| 41 |
|
| 42 |
FRAME_SKIP = 2
|
| 43 |
-
KEEP_CONF = 0.
|
| 44 |
-
YOLO_CONF = 0.
|
| 45 |
YOLO_IOU = 0.50
|
| 46 |
CLIP_PAD_S = 2.0
|
| 47 |
MIN_SEP_S = 1.2
|
|
@@ -144,8 +144,9 @@ def isolate_scoreboard_color(frame_bgr: np.ndarray,
|
|
| 144 |
gray = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2GRAY)
|
| 145 |
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
|
| 146 |
|
| 147 |
-
primary_thr = max(0.
|
| 148 |
-
fallback_thr = max(0.
|
|
|
|
| 149 |
|
| 150 |
chosen_box = None
|
| 151 |
res = yolo().predict(frame_bgr, conf=conf, iou=iou, verbose=False)
|
|
@@ -287,7 +288,7 @@ def predict_scores(df):
|
|
| 287 |
|
| 288 |
|
| 289 |
def pick_events(df,score,fps):
|
| 290 |
-
z=rolling_z(score,45); strong=(z>
|
| 291 |
min_dist=max(1,int(MIN_SEP_S*fps))
|
| 292 |
y=score.values; out=[]; last=-min_dist
|
| 293 |
for i in range(1,len(y)-1):
|
|
|
|
| 40 |
AG_ZIP_NAME = "autogluon_predictor_dir.zip"
|
| 41 |
|
| 42 |
FRAME_SKIP = 2
|
| 43 |
+
KEEP_CONF = 0.85
|
| 44 |
+
YOLO_CONF = 0.35
|
| 45 |
YOLO_IOU = 0.50
|
| 46 |
CLIP_PAD_S = 2.0
|
| 47 |
MIN_SEP_S = 1.2
|
|
|
|
| 144 |
gray = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2GRAY)
|
| 145 |
gray = cv2.cvtColor(gray, cv2.COLOR_GRAY2BGR)
|
| 146 |
|
| 147 |
+
primary_thr = max(0.90, keep_conf)
|
| 148 |
+
fallback_thr = max(0.75, primary_thr - 0.03)
|
| 149 |
+
|
| 150 |
|
| 151 |
chosen_box = None
|
| 152 |
res = yolo().predict(frame_bgr, conf=conf, iou=iou, verbose=False)
|
|
|
|
| 288 |
|
| 289 |
|
| 290 |
def pick_events(df,score,fps):
|
| 291 |
+
z=rolling_z(score,45); strong=(z>5.0); keep=strong.rolling(4,min_periods=2).sum()>=3
|
| 292 |
min_dist=max(1,int(MIN_SEP_S*fps))
|
| 293 |
y=score.values; out=[]; last=-min_dist
|
| 294 |
for i in range(1,len(y)-1):
|