Spaces:
Runtime error
Runtime error
Commit ·
767d5c4
1
Parent(s): 41e552b
fix progress
Browse files
app.py
CHANGED
|
@@ -56,7 +56,7 @@ def inference(x, count_only_api, api_key,
|
|
| 56 |
img_size=224, seq_len=64, stride_length=32, stride_pad=3, batch_size=4,
|
| 57 |
miss_threshold=0.8, marks_threshold=0.6, median_pred_filter=True, center_crop=True, both_feet=True,
|
| 58 |
api_call=False,
|
| 59 |
-
progress=gr.Progress(
|
| 60 |
progress(0, desc="Starting...")
|
| 61 |
# check if GPU is available
|
| 62 |
if torch.cuda.is_available():
|
|
@@ -156,6 +156,7 @@ def inference(x, count_only_api, api_key,
|
|
| 156 |
event_type_logit_overlaps[idx:idx+seq_len] += 1
|
| 157 |
batch_list = []
|
| 158 |
idx_list = []
|
|
|
|
| 159 |
if len(batch_list) != 0: # still some leftover frames
|
| 160 |
while len(batch_list) != batch_size:
|
| 161 |
batch_list.append(batch_list[-1])
|
|
@@ -291,7 +292,7 @@ def inference(x, count_only_api, api_key,
|
|
| 291 |
fig.update_traces(marker_line_width = 0)
|
| 292 |
fig.update_layout(coloraxis_colorbar=dict(
|
| 293 |
tickvals=event_type_tick_vals,
|
| 294 |
-
ticktext=['single
|
| 295 |
title='event type'
|
| 296 |
))
|
| 297 |
|
|
@@ -304,7 +305,7 @@ def inference(x, count_only_api, api_key,
|
|
| 304 |
|
| 305 |
# make a bar plot of the event type distribution
|
| 306 |
|
| 307 |
-
bar = px.bar(x=['single rope
|
| 308 |
y=event_type_probs,
|
| 309 |
template="plotly_dark",
|
| 310 |
title="Event Type Distribution",
|
|
|
|
| 56 |
img_size=224, seq_len=64, stride_length=32, stride_pad=3, batch_size=4,
|
| 57 |
miss_threshold=0.8, marks_threshold=0.6, median_pred_filter=True, center_crop=True, both_feet=True,
|
| 58 |
api_call=False,
|
| 59 |
+
progress=gr.Progress()):
|
| 60 |
progress(0, desc="Starting...")
|
| 61 |
# check if GPU is available
|
| 62 |
if torch.cuda.is_available():
|
|
|
|
| 156 |
event_type_logit_overlaps[idx:idx+seq_len] += 1
|
| 157 |
batch_list = []
|
| 158 |
idx_list = []
|
| 159 |
+
progress(i / (length + stride_length - stride_pad), desc="Processing...")
|
| 160 |
if len(batch_list) != 0: # still some leftover frames
|
| 161 |
while len(batch_list) != batch_size:
|
| 162 |
batch_list.append(batch_list[-1])
|
|
|
|
| 292 |
fig.update_traces(marker_line_width = 0)
|
| 293 |
fig.update_layout(coloraxis_colorbar=dict(
|
| 294 |
tickvals=event_type_tick_vals,
|
| 295 |
+
ticktext=['single<br>rope', 'double<br>dutch', 'double<br>unders', 'single<br>bounces', 'double<br>bounces', 'triple<br>unders', 'other'],
|
| 296 |
title='event type'
|
| 297 |
))
|
| 298 |
|
|
|
|
| 305 |
|
| 306 |
# make a bar plot of the event type distribution
|
| 307 |
|
| 308 |
+
bar = px.bar(x=['single rope', 'double dutch', 'double unders', 'single bounces', 'double bounces', 'triple unders', 'other'],
|
| 309 |
y=event_type_probs,
|
| 310 |
template="plotly_dark",
|
| 311 |
title="Event Type Distribution",
|