Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ print(main_dir)
|
|
27 |
|
28 |
os.chdir(main_dir)
|
29 |
models_dir = "models"
|
30 |
-
|
31 |
|
32 |
|
33 |
|
@@ -54,11 +54,8 @@ def download_audio(url):
|
|
54 |
|
55 |
|
56 |
# Define a function to handle the entire separation process
|
57 |
-
def separate_audio(input_audio,
|
58 |
-
|
59 |
-
if not os.path.exists(output_dir):
|
60 |
-
os.makedirs(output_dir)
|
61 |
-
|
62 |
separator = Separator(output_dir=output_dir)
|
63 |
|
64 |
# Define output files
|
@@ -211,7 +208,7 @@ if __name__ == '__main__':
|
|
211 |
|
212 |
|
213 |
# Gradio Blocks Interface with Tabs
|
214 |
-
with gr.Blocks(title="Hex RVC",
|
215 |
gr.Markdown("# Hex RVC")
|
216 |
|
217 |
with gr.Tab("Inference"):
|
@@ -272,8 +269,7 @@ with gr.Blocks(title="Hex RVC", theme="gradio/soft") as app:
|
|
272 |
with gr.Tab("Audio Separation"):
|
273 |
with gr.Row():
|
274 |
input_audio = gr.Audio(type="filepath", label="Upload Audio File")
|
275 |
-
|
276 |
-
|
277 |
with gr.Row():
|
278 |
with gr.Accordion("Separation by Link", open = False):
|
279 |
with gr.Row():
|
@@ -309,7 +305,7 @@ with gr.Blocks(title="Hex RVC", theme="gradio/soft") as app:
|
|
309 |
|
310 |
separate_button.click(
|
311 |
separate_audio,
|
312 |
-
inputs=[input_audio,
|
313 |
outputs=[instrumental_out, vocals_out, vocals_reverb_out, vocals_no_reverb_out, lead_vocals_out, backing_vocals_out]
|
314 |
)
|
315 |
|
|
|
27 |
|
28 |
os.chdir(main_dir)
|
29 |
models_dir = "models"
|
30 |
+
audio_separat_dir = main_dir / "audio_input"
|
31 |
|
32 |
|
33 |
|
|
|
54 |
|
55 |
|
56 |
# Define a function to handle the entire separation process
|
57 |
+
def separate_audio(input_audio, model_voc_inst, model_deecho, model_back_voc):
|
58 |
+
output_dir = audio_separat_dir
|
|
|
|
|
|
|
59 |
separator = Separator(output_dir=output_dir)
|
60 |
|
61 |
# Define output files
|
|
|
208 |
|
209 |
|
210 |
# Gradio Blocks Interface with Tabs
|
211 |
+
with gr.Blocks(title="Hex RVC", themegr.themes.Default(primary_hue="red", secondary_hue="pink")) as app:
|
212 |
gr.Markdown("# Hex RVC")
|
213 |
|
214 |
with gr.Tab("Inference"):
|
|
|
269 |
with gr.Tab("Audio Separation"):
|
270 |
with gr.Row():
|
271 |
input_audio = gr.Audio(type="filepath", label="Upload Audio File")
|
272 |
+
|
|
|
273 |
with gr.Row():
|
274 |
with gr.Accordion("Separation by Link", open = False):
|
275 |
with gr.Row():
|
|
|
305 |
|
306 |
separate_button.click(
|
307 |
separate_audio,
|
308 |
+
inputs=[input_audio, model_voc_inst, model_deecho, model_back_voc],
|
309 |
outputs=[instrumental_out, vocals_out, vocals_reverb_out, vocals_no_reverb_out, lead_vocals_out, backing_vocals_out]
|
310 |
)
|
311 |
|