XDHDD commited on
Commit
00cabc9
1 Parent(s): cc80c14

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -16
app.py CHANGED
@@ -205,21 +205,21 @@ if st.button('Сгенерировать потери'):
205
  stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
206
 
207
 
208
- def get_power(x, nfft):
209
- S = librosa.stft(x, n_fft=nfft)
210
- S = np.log(np.abs(S) ** 2 + 1e-8)
211
- return S
212
- def LSD(x_hr, x_pr):
213
- S1 = get_power(x_hr, nfft=2048)
214
- S2 = get_power(x_pr, nfft=2048)
215
- lsd = np.mean(np.sqrt(np.mean((S1 - S2) ** 2, axis=-1)), axis=0)
216
- return lsd
217
-
218
- lsd_orig = LSD(data_clean,data_clean)
219
- lsd_lossy = LSD(data_lossy,data_clean)
220
- lsd_enhanced = LSD(data_enhanced,data_clean)
221
-
222
- lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
223
 
224
  if samplerate != 16000:
225
  data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
@@ -290,6 +290,6 @@ if st.button('Сгенерировать потери'):
290
  #df_2.columns = new_columns
291
  #df_merged = df_1.merge(df_2, left_index=True, right_index=True)
292
 
293
- st.data_editor(df_1, hide_index = True )
294
 
295
 
 
205
  stoi_mass=[stoi_orig, stoi_lossy, stoi_enhanced]
206
 
207
 
208
+ #def get_power(x, nfft):
209
+ # S = librosa.stft(x, n_fft=nfft)
210
+ # S = np.log(np.abs(S) ** 2 + 1e-8)
211
+ # return S
212
+ #def LSD(x_hr, x_pr):
213
+ # S1 = get_power(x_hr, nfft=2048)
214
+ # S2 = get_power(x_pr, nfft=2048)
215
+ # lsd = np.mean(np.sqrt(np.mean((S1 - S2) ** 2, axis=-1)), axis=0)
216
+ # return lsd
217
+
218
+ #lsd_orig = LSD(data_clean,data_clean)
219
+ #lsd_lossy = LSD(data_lossy,data_clean)
220
+ #lsd_enhanced = LSD(data_enhanced,data_clean)
221
+
222
+ #lsd_mass=[lsd_orig, lsd_lossy, lsd_enhanced]
223
 
224
  if samplerate != 16000:
225
  data_lossy = librosa.resample(data_lossy, orig_sr=48000, target_sr=16000)
 
290
  #df_2.columns = new_columns
291
  #df_merged = df_1.merge(df_2, left_index=True, right_index=True)
292
 
293
+ st.dataframe(df_1, hide_index = True, use_container_width=st.session_state.use_container_width)
294
 
295