Update app.py
Browse files
app.py
CHANGED
@@ -136,27 +136,27 @@ if st.button('Сгенерировать потери'):
|
|
136 |
|
137 |
|
138 |
stoi = STOI(48000)
|
139 |
-
stoi_orig =
|
140 |
-
stoi_lossy =
|
141 |
-
stoi_enhanced =
|
142 |
stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
143 |
|
144 |
|
145 |
-
|
146 |
-
data_clean = data_clean.cpu().numpy()
|
147 |
-
data_lossy = data_lossy.detach().cpu().numpy()
|
148 |
-
data_enhanced = data_enhanced.cpu().numpy()
|
149 |
|
150 |
-
if samplerate != 16000:
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
159 |
-
psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
|
160 |
|
161 |
|
162 |
|
|
|
136 |
|
137 |
|
138 |
stoi = STOI(48000)
|
139 |
+
stoi_orig = round(float(stoi(data_clean, data_clean)),3)
|
140 |
+
stoi_lossy = round(float(stoi(data_clean, data_lossy)),5)
|
141 |
+
stoi_enhanced = round(float(stoi(data_clean, data_enhanced)),5)
|
142 |
stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
|
143 |
|
144 |
|
145 |
+
#pesq = PESQ(16000, 'nb')
|
146 |
+
#data_clean = data_clean.cpu().numpy()
|
147 |
+
#data_lossy = data_lossy.detach().cpu().numpy()
|
148 |
+
#data_enhanced = data_enhanced.cpu().numpy()
|
149 |
|
150 |
+
#if samplerate != 16000:
|
151 |
+
# data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
|
152 |
+
# data_clean = librosa.resample(data_clean, orig_sr=48000, target_sr=16000)
|
153 |
+
# data_enhanced = librosa.resample(data_enhanced, orig_sr=48000, target_sr=16000)
|
154 |
|
155 |
+
# pesq_orig = np.array(pesq(torch.tensor(data_clean), torch.tensor(data_clean)))
|
156 |
+
# pesq_lossy = np.array(pesq(torch.tensor(data_lossy), torch.tensor(data_clean)))
|
157 |
+
# pesq_enhanced = np.array(pesq(torch.tensor(data_enhanced), torch.tensor(data_clean)))
|
158 |
|
159 |
+
#psq_mas=[pesq_orig, pesq_lossy, pesq_enhanced]
|
160 |
|
161 |
|
162 |
|