XDHDD commited on
Commit
2d4c9d5
1 Parent(s): bd7db8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -212,16 +212,16 @@ if st.button('Сгенерировать потери'):
212
 
213
  lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
214
 
215
- if samplerate != 8000:
216
- data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=8000)
217
- data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=8000)
218
- data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=8000)
219
 
220
 
221
 
222
- pesq_orig = pesq(fs = 8000, ref = data_clean, deg = data_clean, mode='nb')
223
- pesq_lossy = pesq(fs = 8000, ref = data_clean, deg = data_lossy, mode='nb')
224
- pesq_enhanced = pesq(fs = 8000, ref = data_clean, deg = data_enhanced, mode='nb')
225
 
226
  psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
227
 
 
212
 
213
  lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
214
 
215
+ if samplerate != 16000:
216
+ data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
217
+ data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=16000)
218
+ data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=16000)
219
 
220
 
221
 
222
+ pesq_orig = pesq(fs = 16000, ref = data_clean, deg = data_clean, mode='wb')
223
+ pesq_lossy = pesq(fs = 16000, ref = data_clean, deg = data_lossy, mode='wb')
224
+ pesq_enhanced = pesq(fs = 16000, ref = data_clean, deg = data_enhanced, mode='wb')
225
 
226
  psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
227