demucs-cpu / app.py
whooray's picture
Update app.py
e607d6c verified
raw
history blame
636 Bytes
import os
import gradio as gr
from scipy.io.wavfile import write
def inference(audio):
os.makedirs("out", exist_ok=True)
write('test.wav', audio[0], audio[1])
os.system("python3 -m demucs.separate -n mdx_extra_q --two-stems=vocals -d cpu test.wav -o out")
return "./out/mdx_extra_q/test/vocals.wav","./out/mdx_extra_q/test/no_vocals.wav"
title = "음성 분리"
demo = gr.Interface(
inference,
gr.Audio(type="numpy", label="Input"),
[gr.Audio(type="filepath", label="Vocals"),gr.Audio(type="filepath", label="No Vocals / Instrumental")],
title=title,
)
demo.queue(max_size=1)
demo.launch(debug=True)