Spaces:
Running
Running
Commit
·
e721a01
1
Parent(s):
8a07750
seventh commit
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ def main(input, mix_coefficient):
|
|
66 |
parser.add_argument(
|
67 |
"--save_mixed_output",
|
68 |
type=float,
|
69 |
-
default=
|
70 |
help="Save original+delimited-estimation mixed output with a ratio of default 0.5 (orginal) and 1 - 0.5 (estimation)",
|
71 |
)
|
72 |
parser.add_argument(
|
@@ -142,20 +142,10 @@ def main(input, mix_coefficient):
|
|
142 |
args, our_model, device, track_audio, track_name, meter, augmented_gain
|
143 |
)
|
144 |
|
145 |
-
if args.save_mixed_output:
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
mixed_output = orig_audio * args.save_mixed_output + estimates * (
|
151 |
-
1 - args.save_mixed_output
|
152 |
-
)
|
153 |
-
|
154 |
-
sf.write(
|
155 |
-
f"{args.test_output_dir}/{track_name}/{track_name}_mixed.wav",
|
156 |
-
mixed_output.T,
|
157 |
-
args.data_params.sample_rate,
|
158 |
-
)
|
159 |
|
160 |
return (
|
161 |
(sr, estimates.T),
|
@@ -245,7 +235,7 @@ with gr.Blocks() as demo:
|
|
245 |
)
|
246 |
slider.release(
|
247 |
parallel_mix,
|
248 |
-
inputs=[
|
249 |
outputs=output_audio_parallel,
|
250 |
)
|
251 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
@@ -278,16 +268,16 @@ with gr.Blocks() as demo:
|
|
278 |
],
|
279 |
outputs=plot,
|
280 |
)
|
281 |
-
slider.release(
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
)
|
292 |
if __name__ == "__main__":
|
293 |
demo.launch(debug=True)
|
|
|
66 |
parser.add_argument(
|
67 |
"--save_mixed_output",
|
68 |
type=float,
|
69 |
+
default=True,
|
70 |
help="Save original+delimited-estimation mixed output with a ratio of default 0.5 (orginal) and 1 - 0.5 (estimation)",
|
71 |
)
|
72 |
parser.add_argument(
|
|
|
142 |
args, our_model, device, track_audio, track_name, meter, augmented_gain
|
143 |
)
|
144 |
|
145 |
+
# if args.save_mixed_output:
|
146 |
+
track_lufs = meter.integrated_loudness(orig_audio.T)
|
147 |
+
augmented_gain = args.save_output_loudnorm - track_lufs
|
148 |
+
orig_audio = orig_audio * db2linear(augmented_gain, eps=0.0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
return (
|
151 |
(sr, estimates.T),
|
|
|
235 |
)
|
236 |
slider.release(
|
237 |
parallel_mix,
|
238 |
+
inputs=[loud_norm_input, output_audio, slider],
|
239 |
outputs=output_audio_parallel,
|
240 |
)
|
241 |
with gr.Row().style(mobile_collapse=False, equal_height=True):
|
|
|
268 |
],
|
269 |
outputs=plot,
|
270 |
)
|
271 |
+
# slider.release(
|
272 |
+
# waveform_plot,
|
273 |
+
# inputs=[
|
274 |
+
# loud_norm_input,
|
275 |
+
# output_audio,
|
276 |
+
# output_audio_parallel,
|
277 |
+
# slider_plot_x,
|
278 |
+
# slider_plot_y,
|
279 |
+
# ],
|
280 |
+
# outputs=plot,
|
281 |
+
# )
|
282 |
if __name__ == "__main__":
|
283 |
demo.launch(debug=True)
|