asigalov61
commited on
Commit
•
6d01d0c
1
Parent(s):
88d8b6d
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,7 @@ in_space = os.getenv("SYSTEM") == "spaces"
|
|
24 |
# =================================================================================================
|
25 |
|
26 |
@spaces.GPU
|
27 |
-
def
|
28 |
print('=' * 70)
|
29 |
print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
30 |
start_time = reqtime.time()
|
@@ -210,16 +210,16 @@ if __name__ == "__main__":
|
|
210 |
|
211 |
app = gr.Blocks()
|
212 |
with app:
|
213 |
-
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>
|
214 |
-
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>
|
215 |
gr.Markdown(
|
216 |
-
"![Visitors](https://api.visitorbadge.io/api/visitors?path=asigalov61.
|
217 |
|
218 |
-
|
219 |
|
220 |
run_btn = gr.Button("generate", variant="primary")
|
221 |
|
222 |
-
gr.Markdown("##
|
223 |
|
224 |
output_midi_title = gr.Textbox(label="Output MIDI title")
|
225 |
output_midi_summary = gr.Textbox(label="Output MIDI summary")
|
@@ -227,7 +227,7 @@ if __name__ == "__main__":
|
|
227 |
output_plot = gr.Plot(label="Output MIDI score plot")
|
228 |
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
229 |
|
230 |
-
run_event = run_btn.click(
|
231 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
232 |
|
233 |
app.queue().launch()
|
|
|
24 |
# =================================================================================================
|
25 |
|
26 |
@spaces.GPU
|
27 |
+
def ClassifyMIDI(input_midi):
|
28 |
print('=' * 70)
|
29 |
print('Req start time: {:%Y-%m-%d %H:%M:%S}'.format(datetime.datetime.now(PDT)))
|
30 |
start_time = reqtime.time()
|
|
|
210 |
|
211 |
app = gr.Blocks()
|
212 |
with app:
|
213 |
+
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Advanced MIDI Classifier</h1>")
|
214 |
+
gr.Markdown("<h1 style='text-align: center; margin-bottom: 1rem'>Detailed MIDI classification with transformers</h1>")
|
215 |
gr.Markdown(
|
216 |
+
"![Visitors](https://api.visitorbadge.io/api/visitors?path=asigalov61.Advanced-MIDI-Classifier&style=flat)\n\n")
|
217 |
|
218 |
+
input_midi = gr.File(label="Input MIDI", file_types=[".midi", ".mid", ".kar"])
|
219 |
|
220 |
run_btn = gr.Button("generate", variant="primary")
|
221 |
|
222 |
+
gr.Markdown("## Classification results")
|
223 |
|
224 |
output_midi_title = gr.Textbox(label="Output MIDI title")
|
225 |
output_midi_summary = gr.Textbox(label="Output MIDI summary")
|
|
|
227 |
output_plot = gr.Plot(label="Output MIDI score plot")
|
228 |
output_midi = gr.File(label="Output MIDI file", file_types=[".mid"])
|
229 |
|
230 |
+
run_event = run_btn.click(ClassifyMIDI, [input_midi],
|
231 |
[output_midi_title, output_midi_summary, output_midi, output_audio, output_plot])
|
232 |
|
233 |
app.queue().launch()
|