Spaces:
Build error
Build error
Commit
·
fa0462c
1
Parent(s):
7c627a2
Allow ismirmodel
Browse files
app.py
CHANGED
@@ -53,7 +53,7 @@ def get_audio(url):
|
|
53 |
def populate_metadata(link):
|
54 |
yt = YouTube(link)
|
55 |
audio = get_audio(link)
|
56 |
-
return yt.thumbnail_url, yt.title, audio
|
57 |
|
58 |
def inference(yt_audio_path):
|
59 |
|
@@ -67,7 +67,7 @@ def inference(yt_audio_path):
|
|
67 |
note_seq.sequence_proto_to_midi_file(est_ns, "./transcribed.mid")
|
68 |
|
69 |
synth = note_seq.midi_synth.fluidsynth
|
70 |
-
array_of_floats = synth(est_ns, sample_rate=SAMPLE_RATE)
|
71 |
int16_data = note_seq.audio_io.float_samples_to_int16(array_of_floats)
|
72 |
# piano_roll = create_image_from_note_sequence(note_sequence)
|
73 |
|
@@ -95,7 +95,7 @@ with demo:
|
|
95 |
The mt3 model transcribes multiple simultaneous instruments, but without velocities.
|
96 |
"""
|
97 |
model = gr.Radio(
|
98 |
-
["mt3",],
|
99 |
label=model_label,
|
100 |
value="mt3"
|
101 |
)
|
@@ -107,9 +107,8 @@ with demo:
|
|
107 |
img = gr.Image(label="Thumbnail")
|
108 |
with gr.Row():
|
109 |
yt_audio = gr.Audio()
|
110 |
-
yt_audio_path = gr.Textbox(visible=False)
|
111 |
|
112 |
-
link.change(fn=populate_metadata, inputs=link, outputs=[img, title, yt_audio
|
113 |
|
114 |
with gr.Row():
|
115 |
btn = gr.Button("Transcribe music")
|
@@ -119,7 +118,7 @@ with demo:
|
|
119 |
midi_audio = gr.Audio()
|
120 |
|
121 |
btn.click(inference,
|
122 |
-
inputs=
|
123 |
outputs=[midi_file, midi_audio])
|
124 |
|
125 |
gr.Markdown(article)
|
|
|
53 |
def populate_metadata(link):
|
54 |
yt = YouTube(link)
|
55 |
audio = get_audio(link)
|
56 |
+
return yt.thumbnail_url, yt.title, audio
|
57 |
|
58 |
def inference(yt_audio_path):
|
59 |
|
|
|
67 |
note_seq.sequence_proto_to_midi_file(est_ns, "./transcribed.mid")
|
68 |
|
69 |
synth = note_seq.midi_synth.fluidsynth
|
70 |
+
array_of_floats = synth(est_ns, sample_rate=SAMPLE_RATE, sf2_path=SF2_PATH)
|
71 |
int16_data = note_seq.audio_io.float_samples_to_int16(array_of_floats)
|
72 |
# piano_roll = create_image_from_note_sequence(note_sequence)
|
73 |
|
|
|
95 |
The mt3 model transcribes multiple simultaneous instruments, but without velocities.
|
96 |
"""
|
97 |
model = gr.Radio(
|
98 |
+
["mt3", "ismir2021"],
|
99 |
label=model_label,
|
100 |
value="mt3"
|
101 |
)
|
|
|
107 |
img = gr.Image(label="Thumbnail")
|
108 |
with gr.Row():
|
109 |
yt_audio = gr.Audio()
|
|
|
110 |
|
111 |
+
link.change(fn=populate_metadata, inputs=link, outputs=[img, title, yt_audio])
|
112 |
|
113 |
with gr.Row():
|
114 |
btn = gr.Button("Transcribe music")
|
|
|
118 |
midi_audio = gr.Audio()
|
119 |
|
120 |
btn.click(inference,
|
121 |
+
inputs="final_audio.wav",
|
122 |
outputs=[midi_file, midi_audio])
|
123 |
|
124 |
gr.Markdown(article)
|