Spaces:
Runtime error
Runtime error
Update helper.py
Browse files
helper.py
CHANGED
@@ -77,10 +77,10 @@ def evaluate(estimate, reference):
|
|
77 |
print(f"STOI score: {stoi_mix}")
|
78 |
|
79 |
def get_irms(stft_clean, stft_noise):
|
80 |
-
if stft_clean.size(
|
81 |
-
stft_noise = F.pad(stft_noise, (0, stft_clean.size(
|
82 |
-
elif stft_noise.size(
|
83 |
-
stft_clean = F.pad(stft_clean, (0, stft_noise.size(
|
84 |
mag_clean = stft_clean.abs() ** 2
|
85 |
mag_noise = stft_noise.abs() ** 2
|
86 |
irm_speech = mag_clean / (mag_clean + mag_noise)
|
|
|
77 |
print(f"STOI score: {stoi_mix}")
|
78 |
|
79 |
def get_irms(stft_clean, stft_noise):
|
80 |
+
if stft_clean.size(2) > stft_noise.size(2):
|
81 |
+
stft_noise = F.pad(stft_noise, (0, stft_clean.size(2) - stft_noise.size(2)))
|
82 |
+
elif stft_noise.size(2) > stft_clean.size(2):
|
83 |
+
stft_clean = F.pad(stft_clean, (0, stft_noise.size(2) - stft_clean.size(2)))
|
84 |
mag_clean = stft_clean.abs() ** 2
|
85 |
mag_noise = stft_noise.abs() ** 2
|
86 |
irm_speech = mag_clean / (mag_clean + mag_noise)
|