XDHDD commited on
Commit
b177a3b
1 Parent(s): fb11a7d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -224,16 +224,16 @@ if st.button('Сгенерировать потери'):
224
 
225
  #lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
226
 
227
- if samplerate != 8000:
228
- data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=8000)
229
- data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=8000)
230
- data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=8000)
231
 
232
 
233
 
234
- pesq_orig = pesq(fs = 8000, ref = data_clean, deg = data_clean, mode='nb')
235
- pesq_lossy = pesq(fs = 8000, ref = data_clean, deg = data_lossy, mode='nb')
236
- pesq_enhanced = pesq(fs = 8000, ref = data_clean, deg = data_enhanced, mode='nb')
237
 
238
  psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
239
 
 
224
 
225
  #lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
226
 
227
+ if samplerate != 16000:
228
+ data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
229
+ data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=16000)
230
+ data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=16000)
231
 
232
 
233
 
234
+ pesq_orig = pesq(fs = 16000, ref = data_clean, deg = data_clean, mode='wb')
235
+ pesq_lossy = pesq(fs = 16000, ref = data_clean, deg = data_lossy, mode='wb')
236
+ pesq_enhanced = pesq(fs = 16000, ref = data_clean, deg = data_enhanced, mode='wb')
237
 
238
  psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
239