dylanplummer commited on
Commit
796d94e
·
2 Parent(s): 2fe3d362e41093

Merge branch 'main' of https://huggingface.co/spaces/dylanplummer/NextJump

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -98,9 +98,9 @@ def inference(x, count_only_api, api_key, img_size=192, seq_len=64, stride_lengt
98
  period_lengths = np.zeros(len(all_frames) + seq_len + stride_length)
99
  periodicities = np.zeros(len(all_frames) + seq_len + stride_length)
100
  full_marks = np.zeros(len(all_frames) + seq_len + stride_length)
101
- event_type_logits = np.zeros((len(all_frames) + seq_len + stride_length, 6))
102
  period_length_overlaps = np.zeros(len(all_frames) + seq_len + stride_length)
103
- event_type_logit_overlaps = np.zeros((len(all_frames) + seq_len + stride_length, 6))
104
  for _ in range(seq_len + stride_length): # pad full sequence
105
  all_frames.append(all_frames[-1])
106
  batch_list = []
@@ -240,7 +240,7 @@ def inference(x, count_only_api, api_key, img_size=192, seq_len=64, stride_lengt
240
  jumps_per_second[misses] = 0
241
  frame_type = np.array(['miss' if miss else 'frame' for miss in misses])
242
  frame_type[full_marks > marks_threshold] = 'jump'
243
- per_frame_event_types = np.clip(per_frame_event_types, 0, 6) / 6
244
  df = pd.DataFrame.from_dict({'period length': periodLength,
245
  'jumping speed': jumping_speed,
246
  'jumps per second': jumps_per_second,
@@ -302,7 +302,7 @@ def inference(x, count_only_api, api_key, img_size=192, seq_len=64, stride_lengt
302
 
303
  # make a bar plot of the event type distribution
304
 
305
- bar = px.bar(x=['single rope speed', 'double dutch', 'double unders', 'single bounces', 'double bounces', 'triple unders'],
306
  y=event_type_probs,
307
  template="plotly_dark",
308
  title="Event Type Distribution",
 
98
  period_lengths = np.zeros(len(all_frames) + seq_len + stride_length)
99
  periodicities = np.zeros(len(all_frames) + seq_len + stride_length)
100
  full_marks = np.zeros(len(all_frames) + seq_len + stride_length)
101
+ event_type_logits = np.zeros((len(all_frames) + seq_len + stride_length, 7))
102
  period_length_overlaps = np.zeros(len(all_frames) + seq_len + stride_length)
103
+ event_type_logit_overlaps = np.zeros((len(all_frames) + seq_len + stride_length, 7))
104
  for _ in range(seq_len + stride_length): # pad full sequence
105
  all_frames.append(all_frames[-1])
106
  batch_list = []
 
240
  jumps_per_second[misses] = 0
241
  frame_type = np.array(['miss' if miss else 'frame' for miss in misses])
242
  frame_type[full_marks > marks_threshold] = 'jump'
243
+ per_frame_event_types = np.clip(per_frame_event_types, 0, 7) / 7
244
  df = pd.DataFrame.from_dict({'period length': periodLength,
245
  'jumping speed': jumping_speed,
246
  'jumps per second': jumps_per_second,
 
302
 
303
  # make a bar plot of the event type distribution
304
 
305
+ bar = px.bar(x=['single rope speed', 'double dutch', 'double unders', 'single bounces', 'double bounces', 'triple unders', 'other'],
306
  y=event_type_probs,
307
  template="plotly_dark",
308
  title="Event Type Distribution",