Remove crop_audio_window from DataLoader.py

This commit is contained in:
czk32611
2024-06-01 22:23:47 +08:00
committed by GitHub
parent 30dcd5237f
commit 6d19f3c0c8

View File

@@ -118,18 +118,6 @@ class Dataset(object):
return window
def crop_audio_window(self, spec, start_frame):
if type(start_frame) == int:
start_frame_num = start_frame
else:
start_frame_num = self.get_frame_id(start_frame)
start_idx = int(80. * (start_frame_num / float(hparams.fps)))
end_idx = start_idx + syncnet_mel_step_size
return spec[start_idx : end_idx, :]
def prepare_window(self, window):
# 1 x H x W x 3
x = np.asarray(window) / 255.
@@ -249,4 +237,4 @@ if __name__ == "__main__":
ref_image, image, masked_image, mask, audio_feature = data
print("ref_image: ", ref_image.shape)