dylanplummer commited on
Commit
08775f1
·
1 Parent(s): cf3f9fd

update examples

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -231,7 +231,7 @@ def inference(x, count_only_api, api_key, img_size=192, seq_len=64, stride_lengt
231
  jumps_per_second[misses] = 0
232
  frame_type = np.array(['miss' if miss else 'frame' for miss in misses])
233
  frame_type[full_marks > marks_threshold] = 'jump'
234
- per_frame_event_types = per_frame_event_types / 6
235
  df = pd.DataFrame.from_dict({'period length': periodLength,
236
  'jumping speed': jumping_speed,
237
  'jumps per second': jumps_per_second,
@@ -305,7 +305,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
305
  gr.Markdown(DESCRIPTION)
306
  with gr.Column():
307
  with gr.Row():
308
- in_video = gr.Video(label="Input Video", elem_id='input-video', format='mp4', width=400, height=400, interactive=True)
309
 
310
  with gr.Row():
311
  run_button = gr.Button(label="Run", elem_id='run-button', scale=1)
@@ -351,10 +351,10 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
351
  [os.path.join(os.path.dirname(__file__), "files", "dylan.mp4")],
352
  [os.path.join(os.path.dirname(__file__), "files", "train14.mp4")],
353
  [os.path.join(os.path.dirname(__file__), "files", "train_17.mp4")],
354
- [os.path.join(os.path.dirname(__file__), "files", "train13.mp4")],
355
- [os.path.join(os.path.dirname(__file__), "files", "train_213.mp4")],
356
  [os.path.join(os.path.dirname(__file__), "files", "train_156.mp4")],
357
- [os.path.join(os.path.dirname(__file__), "files", "train_202.mp4")],
358
  [os.path.join(os.path.dirname(__file__), "files", "train_57.mp4")],
359
  [os.path.join(os.path.dirname(__file__), "files", "train_95.mp4")],
360
  [os.path.join(os.path.dirname(__file__), "files", "train_253.mp4")],
 
231
  jumps_per_second[misses] = 0
232
  frame_type = np.array(['miss' if miss else 'frame' for miss in misses])
233
  frame_type[full_marks > marks_threshold] = 'jump'
234
+ per_frame_event_types = np.clip(per_frame_event_types, 0, 6) / 6
235
  df = pd.DataFrame.from_dict({'period length': periodLength,
236
  'jumping speed': jumping_speed,
237
  'jumps per second': jumps_per_second,
 
305
  gr.Markdown(DESCRIPTION)
306
  with gr.Column():
307
  with gr.Row():
308
+ in_video = gr.PlayableVideo(label="Input Video", elem_id='input-video', format='mp4', width=400, height=400, interactive=True)
309
 
310
  with gr.Row():
311
  run_button = gr.Button(label="Run", elem_id='run-button', scale=1)
 
351
  [os.path.join(os.path.dirname(__file__), "files", "dylan.mp4")],
352
  [os.path.join(os.path.dirname(__file__), "files", "train14.mp4")],
353
  [os.path.join(os.path.dirname(__file__), "files", "train_17.mp4")],
354
+ #[os.path.join(os.path.dirname(__file__), "files", "train13.mp4")],
355
+ #[os.path.join(os.path.dirname(__file__), "files", "train_213.mp4")],
356
  [os.path.join(os.path.dirname(__file__), "files", "train_156.mp4")],
357
+ #[os.path.join(os.path.dirname(__file__), "files", "train_202.mp4")],
358
  [os.path.join(os.path.dirname(__file__), "files", "train_57.mp4")],
359
  [os.path.join(os.path.dirname(__file__), "files", "train_95.mp4")],
360
  [os.path.join(os.path.dirname(__file__), "files", "train_253.mp4")],