Spaces:
Sleeping
Sleeping
Initial commit: Gradio app and requirements
Browse files
app.py
CHANGED
|
@@ -94,12 +94,27 @@ with gr.Blocks() as demo:
|
|
| 94 |
gr.Markdown("# Classical Music Composer Classifier")
|
| 95 |
gr.Markdown("Predict whether a piece was composed by **Mozart** or **Beethoven**.")
|
| 96 |
with gr.Row():
|
| 97 |
-
rh = gr.Number(150,
|
| 98 |
-
|
| 99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
with gr.Row():
|
| 101 |
-
key_center = gr.Dropdown(
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
out_label = gr.Textbox(label="Predicted Composer")
|
| 105 |
out_probs = gr.Label(num_top_classes=2, label="Probabilities")
|
|
|
|
| 94 |
gr.Markdown("# Classical Music Composer Classifier")
|
| 95 |
gr.Markdown("Predict whether a piece was composed by **Mozart** or **Beethoven**.")
|
| 96 |
with gr.Row():
|
| 97 |
+
rh = gr.Number(value=150,
|
| 98 |
+
precision=0,
|
| 99 |
+
label="Right Hand Notes",
|
| 100 |
+
info="Number of notes played by right hand")
|
| 101 |
+
lh = gr.Number(value=100,
|
| 102 |
+
precision=0,
|
| 103 |
+
label="Left Hand Notes",
|
| 104 |
+
info="Number of notes played by left hand")
|
| 105 |
+
measures = gr.Number(value=20,
|
| 106 |
+
precision=0,
|
| 107 |
+
label="Measures",
|
| 108 |
+
info="Number of musical measures")
|
| 109 |
with gr.Row():
|
| 110 |
+
key_center = gr.Dropdown(choices=[(f"{v} ({k})", k) for k, v in key_center_mapping.items()],
|
| 111 |
+
value=3,
|
| 112 |
+
label="Key Center",
|
| 113 |
+
info="Musical key of the piece")
|
| 114 |
+
marking = gr.Dropdown(choices=[(f"{v} ({k})", k) for k, v in marking_mapping.items()],
|
| 115 |
+
value=1,
|
| 116 |
+
label="Musical Marking",
|
| 117 |
+
info="Tempo/style marking of the piece")
|
| 118 |
|
| 119 |
out_label = gr.Textbox(label="Predicted Composer")
|
| 120 |
out_probs = gr.Label(num_top_classes=2, label="Probabilities")
|