roychao19477 commited on
Commit
87f4188
·
1 Parent(s): 27bac1c

Update chunk feature

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -126,7 +126,8 @@ def run_avse_inference(video_path, audio_path):
126
  audio_chunk = np.concatenate([audio_chunk, pad])
127
 
128
  vid_idx = i // sr * 25 # convert audio index to video frame index
129
- video_chunk = bg_frames[0, vid_idx:vid_idx+video_chunk_len, :, :]
 
130
  if video_chunk.shape[0] < video_chunk_len:
131
  pad = np.zeros((video_chunk_len - video_chunk.shape[0], *video_chunk.shape[1:]), dtype=video_chunk.dtype)
132
  video_chunk = np.concatenate([video_chunk, pad], axis=0)
 
126
  audio_chunk = np.concatenate([audio_chunk, pad])
127
 
128
  vid_idx = i // sr * 25 # convert audio index to video frame index
129
+ video_chunk = bg_frames[vid_idx:vid_idx+video_chunk_len, :, :]
130
+ video_chunk = video_chunk[np.newaxis, ...] # add batch dim
131
  if video_chunk.shape[0] < video_chunk_len:
132
  pad = np.zeros((video_chunk_len - video_chunk.shape[0], *video_chunk.shape[1:]), dtype=video_chunk.dtype)
133
  video_chunk = np.concatenate([video_chunk, pad], axis=0)