|
|
import gradio as gr |
|
|
from demucs_split import demucs_split |
|
|
import os |
|
|
import json |
|
|
|
|
|
with gr.Blocks(theme=gr.themes.Ocean(), title="Demuxer") as demo: |
|
|
gr.Markdown("# Demuxer") |
|
|
with gr.Row(): |
|
|
url_or_path = gr.Audio(label="Audio file", type="filepath") |
|
|
demucs_model = gr.Dropdown( |
|
|
choices=["mdx", "mdx_extra", "mdx_q", "mdx_extra_q", "htdemucs", "htdemucs_ft", "hdemucs_mmi"], |
|
|
value="mdx_extra", |
|
|
label="Demucs Model" |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
vocal = gr.Audio(label="Vocal", type="filepath") |
|
|
music = gr.Audio(label="Music", type="filepath") |
|
|
|
|
|
run_btn = gr.Button("Split") |
|
|
|
|
|
run_btn.click( |
|
|
demucs_split, |
|
|
inputs=[ |
|
|
url_or_path, |
|
|
demucs_model, |
|
|
], |
|
|
outputs=[vocal, music], |
|
|
show_progress=True |
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
demo.launch(debug=True) |