Skip to content
Permalink
Browse files

Handle variable-length audio by default

  • Loading branch information
daemon committed Dec 17, 2019
1 parent f5bd3c6 commit 850912132b734d2d83b305e71b5bc216803952e8
Showing with 1 addition and 1 deletion.
  1. +1 −1 utils/model.py
@@ -255,7 +255,7 @@ def collate_fn(self, data):
y = []
for audio_data, label in data:
if self.audio_preprocess_type == "MFCCs":
audio_tensor = torch.from_numpy(self.audio_processor.compute_mfccs(audio_data).reshape(1, 101, 40))
audio_tensor = torch.from_numpy(self.audio_processor.compute_mfccs(audio_data).reshape(1, -1, 40))
x = audio_tensor if x is None else torch.cat((x, audio_tensor), 0)
elif self.audio_preprocess_type == "PCEN":
audio_tensor = torch.from_numpy(np.expand_dims(audio_data, axis=0))

0 comments on commit 8509121

Please sign in to comment.
You can’t perform that action at this time.