sindhuhegde commited on
Commit
638c0b5
·
1 Parent(s): 3db6ff1

Update app

Browse files
Files changed (1) hide show
  1. app.py +11 -14
app.py CHANGED
@@ -1322,18 +1322,18 @@ def process_video_syncoffset(video_path, num_avg_frames, apply_preprocess):
1322
  msg = "Error: The input video is too short. Please use a longer input video."
1323
  return None, msg
1324
 
1325
- if apply_preprocess:
1326
- # Load keypoints and check if gestures are visible
1327
- kp_dict, status = get_keypoints(frames)
1328
- if status != "success":
1329
- return None, status
1330
- print("Successfully extracted the keypoints: ", len(kp_dict), len(kp_dict["kps"]))
1331
 
1332
- status = check_visible_gestures(kp_dict)
1333
- if status != "success":
1334
- return None, status
1335
- else:
1336
- kp_dict = None
1337
 
1338
  # Load RGB frames
1339
  rgb_frames, num_frames, orig_masked_frames, status = load_rgb_masked_frames(frames, kp_dict, asd=False, window_frames=25, width=480, height=270)
@@ -1520,11 +1520,8 @@ def process_video_activespeaker(video_path, global_speaker, num_avg_frames):
1520
 
1521
  if idx==0:
1522
  video_emb, audio_emb = get_embeddings(video_sequences, audio_sequences, model, asd=True, calc_aud_emb=True)
1523
- video_emb = torch.cat(video_emb, dim=0)
1524
- audio_emb = torch.cat(audio_emb, dim=0)
1525
  else:
1526
  video_emb = get_embeddings(video_sequences, audio_sequences, model, asd=True, calc_aud_emb=False)
1527
- video_emb = torch.cat(video_emb, dim=0)
1528
  all_video_embs.append(video_emb)
1529
  print("Successfully extracted GestSync embeddings")
1530
 
 
1322
  msg = "Error: The input video is too short. Please use a longer input video."
1323
  return None, msg
1324
 
1325
+ # if apply_preprocess:
1326
+ # Load keypoints and check if gestures are visible
1327
+ kp_dict, status = get_keypoints(frames)
1328
+ if status != "success":
1329
+ return None, status
1330
+ print("Successfully extracted the keypoints: ", len(kp_dict), len(kp_dict["kps"]))
1331
 
1332
+ status = check_visible_gestures(kp_dict)
1333
+ if status != "success":
1334
+ return None, status
1335
+ # else:
1336
+ # kp_dict = None
1337
 
1338
  # Load RGB frames
1339
  rgb_frames, num_frames, orig_masked_frames, status = load_rgb_masked_frames(frames, kp_dict, asd=False, window_frames=25, width=480, height=270)
 
1520
 
1521
  if idx==0:
1522
  video_emb, audio_emb = get_embeddings(video_sequences, audio_sequences, model, asd=True, calc_aud_emb=True)
 
 
1523
  else:
1524
  video_emb = get_embeddings(video_sequences, audio_sequences, model, asd=True, calc_aud_emb=False)
 
1525
  all_video_embs.append(video_emb)
1526
  print("Successfully extracted GestSync embeddings")
1527