Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,9 +3,10 @@ import os
|
|
| 3 |
from audio_separator.separator import Separator
|
| 4 |
|
| 5 |
# Initialize the Separator
|
| 6 |
-
separator = Separator()
|
| 7 |
|
| 8 |
-
|
|
|
|
|
|
|
| 9 |
# Create output directory if it doesn't exist
|
| 10 |
os.makedirs(output_dir, exist_ok=True)
|
| 11 |
|
|
@@ -16,7 +17,7 @@ def separate_audio(input_file, output_dir, model_name):
|
|
| 16 |
output_dir,
|
| 17 |
model_name=model_name,
|
| 18 |
denoise=True,
|
| 19 |
-
output_format=
|
| 20 |
normalization_threshold=0.9,
|
| 21 |
mdx_segment_size=256,
|
| 22 |
mdx_overlap=8,
|
|
@@ -51,6 +52,13 @@ with iface:
|
|
| 51 |
label="Model",
|
| 52 |
value="UVR-MDX-NET-Inst_HQ_3"
|
| 53 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
submit_btn = gr.Button("Separate Audio")
|
| 55 |
with gr.Column():
|
| 56 |
with gr.Row():
|
|
@@ -60,7 +68,7 @@ with iface:
|
|
| 60 |
|
| 61 |
submit_btn.click(
|
| 62 |
process_audio,
|
| 63 |
-
inputs=[audio_input, model_name],
|
| 64 |
outputs=[vocal_output, backing_vocal_output, instrumental_output]
|
| 65 |
)
|
| 66 |
|
|
|
|
| 3 |
from audio_separator.separator import Separator
|
| 4 |
|
| 5 |
# Initialize the Separator
|
|
|
|
| 6 |
|
| 7 |
+
separator = Separator()
|
| 8 |
+
|
| 9 |
+
def separate_audio(input_file, output_dir, model_name, output_format):
|
| 10 |
# Create output directory if it doesn't exist
|
| 11 |
os.makedirs(output_dir, exist_ok=True)
|
| 12 |
|
|
|
|
| 17 |
output_dir,
|
| 18 |
model_name=model_name,
|
| 19 |
denoise=True,
|
| 20 |
+
output_format=output_format,
|
| 21 |
normalization_threshold=0.9,
|
| 22 |
mdx_segment_size=256,
|
| 23 |
mdx_overlap=8,
|
|
|
|
| 52 |
label="Model",
|
| 53 |
value="UVR-MDX-NET-Inst_HQ_3"
|
| 54 |
)
|
| 55 |
+
with gr.Column():
|
| 56 |
+
audio_format = gr.Dropdown(
|
| 57 |
+
choices=["wav", "mp3", "flac"],
|
| 58 |
+
label="Audio Format",
|
| 59 |
+
value="wav"
|
| 60 |
+
)
|
| 61 |
+
|
| 62 |
submit_btn = gr.Button("Separate Audio")
|
| 63 |
with gr.Column():
|
| 64 |
with gr.Row():
|
|
|
|
| 68 |
|
| 69 |
submit_btn.click(
|
| 70 |
process_audio,
|
| 71 |
+
inputs=[audio_input, model_name, audio_format],
|
| 72 |
outputs=[vocal_output, backing_vocal_output, instrumental_output]
|
| 73 |
)
|
| 74 |
|