Vageesh1 commited on
Commit
90748cc
1 Parent(s): ebd1b47

Update helper.py

Browse files
Files changed (1) hide show
  1. helper.py +4 -4
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(1) > stft_noise.size(1):
81
- stft_noise = F.pad(stft_noise, (0, stft_clean.size(1) - stft_noise.size(1)))
82
- elif stft_noise.size(1) > stft_clean.size(1):
83
- stft_clean = F.pad(stft_clean, (0, stft_noise.size(1) - stft_clean.size(1)))
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)