Spaces:
Runtime error
Runtime error
update mdxnet outputs
Browse files
app.py
CHANGED
|
@@ -23,7 +23,7 @@ def inference_mdx(audio_file: str) -> list[str]:
|
|
| 23 |
output_dir = Path("./out/mdx")
|
| 24 |
os.makedirs(output_dir, exist_ok=True)
|
| 25 |
model_bgm_path = MODELS_PATH["bgm"]
|
| 26 |
-
background_path,
|
| 27 |
input_filename=audio_file,
|
| 28 |
output_dir=output_dir,
|
| 29 |
model_path=model_bgm_path,
|
|
@@ -31,7 +31,7 @@ def inference_mdx(audio_file: str) -> list[str]:
|
|
| 31 |
device_base=device_base,
|
| 32 |
)
|
| 33 |
|
| 34 |
-
return
|
| 35 |
|
| 36 |
|
| 37 |
def inference_demucs(audio):
|
|
@@ -47,7 +47,7 @@ if __name__ == "__main__":
|
|
| 47 |
tab_1 = gr.Interface(
|
| 48 |
fn = inference_demucs,
|
| 49 |
inputs = gr.Audio(type="numpy", label="Input"),
|
| 50 |
-
outputs = [gr.Audio(type="filepath", label="Vocals"),gr.Audio(type="filepath", label="
|
| 51 |
title="Demucs Music Source Separation (v4)",
|
| 52 |
article="<p style='text-align: center'><a href='https://arxiv.org/abs/1911.13254' target='_blank'>Music Source Separation in the Waveform Domain</a> | <a href='https://github.com/facebookresearch/demucs' target='_blank'>Github Repo</a> | <a href='https://github.com/facebookresearch/demucs/blob/main/LICENSE' target='_blank'>MIT License</a></p>",
|
| 53 |
api_name="demucs_separation",
|
|
@@ -55,7 +55,7 @@ if __name__ == "__main__":
|
|
| 55 |
tab_2 = gr.Interface(
|
| 56 |
fn = inference_mdx,
|
| 57 |
inputs = gr.Audio(type="filepath", label="Input"),
|
| 58 |
-
outputs = gr.Audio(type="filepath", label="
|
| 59 |
title="MDXNET Music Source Separation",
|
| 60 |
article="<p style='text-align: center'><a href='https://arxiv.org/abs/2111.12203' target='_blank'>KUIELab-MDX-Net: A Two-Stream Neural Network for Music Demixing</a> | <a href='https://github.com/kuielab/mdx-net' target='_blank'>Github Repo</a> | <a href='https://github.com/kuielab/mdx-net/blob/main/LICENSE' target='_blank'>MIT License</a></p>",
|
| 61 |
api_name="mdxnet_separation",
|
|
|
|
| 23 |
output_dir = Path("./out/mdx")
|
| 24 |
os.makedirs(output_dir, exist_ok=True)
|
| 25 |
model_bgm_path = MODELS_PATH["bgm"]
|
| 26 |
+
background_path, vocal_path = run_mdx(model_params=mdx_model_params,
|
| 27 |
input_filename=audio_file,
|
| 28 |
output_dir=output_dir,
|
| 29 |
model_path=model_bgm_path,
|
|
|
|
| 31 |
device_base=device_base,
|
| 32 |
)
|
| 33 |
|
| 34 |
+
return str(vocal_path), str(background_path)
|
| 35 |
|
| 36 |
|
| 37 |
def inference_demucs(audio):
|
|
|
|
| 47 |
tab_1 = gr.Interface(
|
| 48 |
fn = inference_demucs,
|
| 49 |
inputs = gr.Audio(type="numpy", label="Input"),
|
| 50 |
+
outputs = [gr.Audio(type="filepath", label="Vocals"),gr.Audio(type="filepath", label="BGM")],
|
| 51 |
title="Demucs Music Source Separation (v4)",
|
| 52 |
article="<p style='text-align: center'><a href='https://arxiv.org/abs/1911.13254' target='_blank'>Music Source Separation in the Waveform Domain</a> | <a href='https://github.com/facebookresearch/demucs' target='_blank'>Github Repo</a> | <a href='https://github.com/facebookresearch/demucs/blob/main/LICENSE' target='_blank'>MIT License</a></p>",
|
| 53 |
api_name="demucs_separation",
|
|
|
|
| 55 |
tab_2 = gr.Interface(
|
| 56 |
fn = inference_mdx,
|
| 57 |
inputs = gr.Audio(type="filepath", label="Input"),
|
| 58 |
+
outputs = [gr.Audio(type="filepath", label="Vocals"),gr.Audio(type="filepath", label="BGM")],
|
| 59 |
title="MDXNET Music Source Separation",
|
| 60 |
article="<p style='text-align: center'><a href='https://arxiv.org/abs/2111.12203' target='_blank'>KUIELab-MDX-Net: A Two-Stream Neural Network for Music Demixing</a> | <a href='https://github.com/kuielab/mdx-net' target='_blank'>Github Repo</a> | <a href='https://github.com/kuielab/mdx-net/blob/main/LICENSE' target='_blank'>MIT License</a></p>",
|
| 61 |
api_name="mdxnet_separation",
|