Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -100,20 +100,31 @@ def inference(audio_file: str, model_name: str, vocals: bool, drums: bool, bass:
|
|
100 |
|
101 |
# Define the Gradio interface
|
102 |
with gr.Blocks() as iface:
|
103 |
-
|
104 |
-
|
105 |
-
vocals_checkbox = gr.Checkbox(label="Vocals", value=True)
|
106 |
-
drums_checkbox = gr.Checkbox(label="Drums", value=True)
|
107 |
-
bass_checkbox = gr.Checkbox(label="Bass", value=True)
|
108 |
-
other_checkbox = gr.Checkbox(label="Other", value=True)
|
109 |
-
mp3_checkbox = gr.Checkbox(label="Save as MP3", value=False)
|
110 |
-
mp3_bitrate = gr.Slider(128, 320, step=32, label="MP3 Bitrate", visible=False)
|
111 |
-
|
112 |
-
output_audio = gr.Audio(type="filepath")
|
113 |
-
separation_log = gr.Textbox(label="Separation Log", lines=10)
|
114 |
-
|
115 |
-
submit_btn = gr.Button("Process")
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
submit_btn.click(
|
118 |
fn=inference,
|
119 |
inputs=[audio_input, model_dropdown, vocals_checkbox, drums_checkbox, bass_checkbox, other_checkbox, mp3_checkbox, mp3_bitrate],
|
|
|
100 |
|
101 |
# Define the Gradio interface
|
102 |
with gr.Blocks() as iface:
|
103 |
+
gr.Markdown("# Demucs Music Source Separation and Mixing")
|
104 |
+
gr.Markdown("Separate vocals, drums, bass, and other instruments from your music using Demucs and mix the selected stems.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
105 |
|
106 |
+
with gr.Row():
|
107 |
+
with gr.Column(scale=1):
|
108 |
+
audio_input = gr.Audio(type="filepath", label="Upload Audio File")
|
109 |
+
model_dropdown = gr.Dropdown(
|
110 |
+
["htdemucs", "htdemucs_ft", "htdemucs_6s", "hdemucs_mmi", "mdx", "mdx_extra", "mdx_q", "mdx_extra_q"],
|
111 |
+
label="Model Name",
|
112 |
+
value="htdemucs_ft"
|
113 |
+
)
|
114 |
+
with gr.Row():
|
115 |
+
vocals_checkbox = gr.Checkbox(label="Vocals", value=True)
|
116 |
+
drums_checkbox = gr.Checkbox(label="Drums", value=True)
|
117 |
+
with gr.Row():
|
118 |
+
bass_checkbox = gr.Checkbox(label="Bass", value=True)
|
119 |
+
other_checkbox = gr.Checkbox(label="Other", value=True)
|
120 |
+
mp3_checkbox = gr.Checkbox(label="Save as MP3", value=False)
|
121 |
+
mp3_bitrate = gr.Slider(128, 320, step=32, label="MP3 Bitrate", visible=False)
|
122 |
+
submit_btn = gr.Button("Process", variant="primary")
|
123 |
+
|
124 |
+
with gr.Column(scale=1):
|
125 |
+
output_audio = gr.Audio(type="filepath", label="Processed Audio")
|
126 |
+
separation_log = gr.Textbox(label="Separation Log", lines=10)
|
127 |
+
|
128 |
submit_btn.click(
|
129 |
fn=inference,
|
130 |
inputs=[audio_input, model_dropdown, vocals_checkbox, drums_checkbox, bass_checkbox, other_checkbox, mp3_checkbox, mp3_bitrate],
|