Update app.py
Browse files
app.py
CHANGED
@@ -156,16 +156,16 @@ if st.button('Сгенерировать потери'):
|
|
156 |
stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
157 |
|
158 |
|
159 |
-
pesq = PESQ(
|
160 |
|
161 |
data_clean = data_clean.cpu().numpy()
|
162 |
data_lossy = data_lossy.cpu().numpy()
|
163 |
data_enhanced = data_enhanced.cpu().numpy()
|
164 |
|
165 |
-
if samplerate !=
|
166 |
-
data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=
|
167 |
-
data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=
|
168 |
-
data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=
|
169 |
|
170 |
pesq_orig = float(pesq(torch.tensor(data_clean), torch.tensor(data_clean)))
|
171 |
pesq_lossy = float(pesq(torch.tensor(data_lossy), torch.tensor(data_clean)))
|
|
|
156 |
stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
157 |
|
158 |
|
159 |
+
pesq = PESQ(8000, 'nb')
|
160 |
|
161 |
data_clean = data_clean.cpu().numpy()
|
162 |
data_lossy = data_lossy.cpu().numpy()
|
163 |
data_enhanced = data_enhanced.cpu().numpy()
|
164 |
|
165 |
+
if samplerate != 8000:
|
166 |
+
data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=8000)
|
167 |
+
data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=8000)
|
168 |
+
data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=8000)
|
169 |
|
170 |
pesq_orig = float(pesq(torch.tensor(data_clean), torch.tensor(data_clean)))
|
171 |
pesq_lossy = float(pesq(torch.tensor(data_lossy), torch.tensor(data_clean)))
|