tianhk's picture
change output type
11c4563
raw
history blame
950 Bytes
import gradio as gr
import os
from pathlib import Path
os.system("midi_ddsp_download_model_weights")
def inference(audio):
os.system("midi_ddsp_synthesize --midi_path "+audio.name)
return Path(audio.name).stem+"/0_violin.wav"
# title = "Midi-DDSP"
# description = "Gradio demo for MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling. To use it, simply upload your midi file, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2112.09312' target='_blank'>MIDI-DDSP: Detailed Control of Musical Performance via Hierarchical Modeling</a> | <a href='https://github.com/magenta/midi-ddsp' target='_blank'>Github Repo</a></p>"
gr.Interface(
inference,
gr.inputs.File(type="file", label="Input"),
[gr.outputs.Audio(type="numpy", label="Output")],
article=article,
enable_queue=True
).launch(debug=True)