Commit ·
c768e8e
1
Parent(s): 5c09023
add double dutch example
Browse files
app.py
CHANGED
|
@@ -135,8 +135,9 @@ def inference(stream_url, start_time, end_time, beep_detection_on, event_length,
|
|
| 135 |
has_access = pbkdf2_sha256.verify(os.environ['DEV_API_TOKEN'], api_key)
|
| 136 |
if not has_access:
|
| 137 |
return "Invalid API Key"
|
| 138 |
-
|
| 139 |
if beep_detection_on:
|
|
|
|
| 140 |
event_start, event_end = detect_beeps(in_video, event_length)
|
| 141 |
print(event_start, event_end)
|
| 142 |
|
|
@@ -303,7 +304,7 @@ def inference(stream_url, start_time, end_time, beep_detection_on, event_length,
|
|
| 303 |
f"single_rope_speed: {event_type_probs[0]:.3f}, double_dutch: {event_type_probs[1]:.3f}, double_unders: {event_type_probs[2]:.3f}, single_bounce: {event_type_probs[3]:.3f}"
|
| 304 |
|
| 305 |
|
| 306 |
-
jumps_per_second = np.clip(1 / ((periodLength / fps) + 0.
|
| 307 |
jumping_speed = np.copy(jumps_per_second)
|
| 308 |
misses = periodicity < miss_threshold
|
| 309 |
jumps_per_second[misses] = 0
|
|
@@ -425,7 +426,8 @@ with gr.Blocks() as demo:
|
|
| 425 |
outputs=[period_length], api_name='inference')
|
| 426 |
examples = [
|
| 427 |
['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_rd2FAyUo/vod', '00:43:10', '00:43:45', True, 30],
|
| 428 |
-
['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_UGEhqlMh/vod', '00:00:18', '00:00:55', True, 30]
|
|
|
|
| 429 |
]
|
| 430 |
gr.Examples(examples,
|
| 431 |
inputs=[in_stream_url, in_stream_start, in_stream_end, beep_detection_on, event_length],
|
|
|
|
| 135 |
has_access = pbkdf2_sha256.verify(os.environ['DEV_API_TOKEN'], api_key)
|
| 136 |
if not has_access:
|
| 137 |
return "Invalid API Key"
|
| 138 |
+
|
| 139 |
if beep_detection_on:
|
| 140 |
+
event_length = int(event_length)
|
| 141 |
event_start, event_end = detect_beeps(in_video, event_length)
|
| 142 |
print(event_start, event_end)
|
| 143 |
|
|
|
|
| 304 |
f"single_rope_speed: {event_type_probs[0]:.3f}, double_dutch: {event_type_probs[1]:.3f}, double_unders: {event_type_probs[2]:.3f}, single_bounce: {event_type_probs[3]:.3f}"
|
| 305 |
|
| 306 |
|
| 307 |
+
jumps_per_second = np.clip(1 / ((periodLength / fps) + 0.0001), 0, 10)
|
| 308 |
jumping_speed = np.copy(jumps_per_second)
|
| 309 |
misses = periodicity < miss_threshold
|
| 310 |
jumps_per_second[misses] = 0
|
|
|
|
| 426 |
outputs=[period_length], api_name='inference')
|
| 427 |
examples = [
|
| 428 |
['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_rd2FAyUo/vod', '00:43:10', '00:43:45', True, 30],
|
| 429 |
+
['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_UGEhqlMh/vod', '00:00:18', '00:00:55', True, 30],
|
| 430 |
+
['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_rd2FAyUo/vod', '01:24:22', '01:25:35', True, 60]
|
| 431 |
]
|
| 432 |
gr.Examples(examples,
|
| 433 |
inputs=[in_stream_url, in_stream_start, in_stream_end, beep_detection_on, event_length],
|