Update app.py
Browse files
app.py
CHANGED
@@ -178,36 +178,36 @@ if st.button('Сгенерировать потери'):
|
|
178 |
|
179 |
|
180 |
#_____________________________________________
|
181 |
-
data_clean, samplerate = sf.read('target.wav')
|
182 |
-
data_lossy, samplerate = sf.read('lossy.wav')
|
183 |
-
data_enhanced, samplerate = sf.read('enhanced.wav')
|
184 |
-
min_len = min(data_clean.shape[0], data_lossy.shape[0], data_enhanced.shape[0])
|
185 |
-
data_clean = data_clean[:min_len]
|
186 |
-
data_lossy = data_lossy[:min_len]
|
187 |
-
data_enhanced = data_enhanced[:min_len]
|
188 |
-
|
189 |
-
|
190 |
-
stoi_orig = round(stoi(data_clean, data_clean, samplerate, extended=False),5)
|
191 |
-
stoi_lossy = round(stoi(data_clean, data_lossy , samplerate, extended=False),5)
|
192 |
-
stoi_enhanced = round(stoi(data_clean, data_enhanced, samplerate, extended=False),5)
|
193 |
|
194 |
-
stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
-
if samplerate != 16000:
|
200 |
-
data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
|
201 |
-
data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=16000)
|
202 |
-
data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=16000)
|
203 |
|
204 |
|
205 |
|
206 |
-
pesq_orig = pesq(fs = 16000, ref = data_clean, deg = data_clean, mode='nb')
|
207 |
-
pesq_lossy = pesq(fs = 16000, ref = data_clean, deg = data_lossy, mode='nb')
|
208 |
-
pesq_enhanced = pesq(fs = 16000, ref = data_clean, deg = data_enhanced, mode='nb')
|
209 |
|
210 |
-
psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
|
211 |
|
212 |
|
213 |
|
|
|
178 |
|
179 |
|
180 |
#_____________________________________________
|
181 |
+
#data_clean, samplerate = sf.read('target.wav')
|
182 |
+
#data_lossy, samplerate = sf.read('lossy.wav')
|
183 |
+
#data_enhanced, samplerate = sf.read('enhanced.wav')
|
184 |
+
#min_len = min(data_clean.shape[0], data_lossy.shape[0], data_enhanced.shape[0])
|
185 |
+
#data_clean = data_clean[:min_len]
|
186 |
+
#data_lossy = data_lossy[:min_len]
|
187 |
+
#data_enhanced = data_enhanced[:min_len]
|
188 |
+
|
189 |
+
|
190 |
+
#stoi_orig = round(stoi(data_clean, data_clean, samplerate, extended=False),5)
|
191 |
+
#stoi_lossy = round(stoi(data_clean, data_lossy , samplerate, extended=False),5)
|
192 |
+
#stoi_enhanced = round(stoi(data_clean, data_enhanced, samplerate, extended=False),5)
|
193 |
|
194 |
+
#stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
195 |
|
196 |
|
197 |
|
198 |
|
199 |
+
#if samplerate != 16000:
|
200 |
+
#data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
|
201 |
+
#data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=16000)
|
202 |
+
#data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=16000)
|
203 |
|
204 |
|
205 |
|
206 |
+
#pesq_orig = pesq(fs = 16000, ref = data_clean, deg = data_clean, mode='nb')
|
207 |
+
#pesq_lossy = pesq(fs = 16000, ref = data_clean, deg = data_lossy, mode='nb')
|
208 |
+
#pesq_enhanced = pesq(fs = 16000, ref = data_clean, deg = data_enhanced, mode='nb')
|
209 |
|
210 |
+
#psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
|
211 |
|
212 |
|
213 |
|