jhtonyKoo commited on
Commit
0a92c9b
1 Parent(s): c13752e

modify app

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -103,16 +103,19 @@ def perform_ito(input_audio, reference_audio, ito_reference_audio, num_steps, op
103
  current_output = current_output.cpu().numpy()
104
 
105
  # Normalize output audio
106
- current_output = loudness_normalize(current_output, args.sample_rate)
107
 
108
  # Denormalize the audio to int16
109
  current_output = denormalize_audio(current_output, dtype=np.int16)
110
-
111
- # Ensure the audio is in the correct shape (samples, channels)
112
  if current_output.ndim == 1:
113
  current_output = current_output.reshape(-1, 1)
114
  elif current_output.ndim > 2:
115
  current_output = current_output.squeeze()
 
 
 
 
116
 
117
  yield (args.sample_rate, current_output), ito_param_output, step, ito_log, loss_values
118
 
 
103
  current_output = current_output.cpu().numpy()
104
 
105
  # Normalize output audio
106
+ # current_output = loudness_normalize(current_output, args.sample_rate)
107
 
108
  # Denormalize the audio to int16
109
  current_output = denormalize_audio(current_output, dtype=np.int16)
110
+
 
111
  if current_output.ndim == 1:
112
  current_output = current_output.reshape(-1, 1)
113
  elif current_output.ndim > 2:
114
  current_output = current_output.squeeze()
115
+
116
+ # Ensure the audio is in the correct shape (samples, channels)
117
+ if current_output.shape[1] > current_output.shape[0]:
118
+ current_output = current_output.transpose(1,0)
119
 
120
  yield (args.sample_rate, current_output), ito_param_output, step, ito_log, loss_values
121