Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,10 +87,16 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
| 87 |
|
| 88 |
with gr.Column():
|
| 89 |
output_label = gr.Label(label="Prediction", num_top_classes=1)
|
| 90 |
-
output_bars = gr.BarPlot(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
|
| 92 |
sketchpad.change(fn=predict_digit, inputs=sketchpad, outputs=[output_label, output_bars])
|
| 93 |
-
upload_btn.upload(fn=
|
| 94 |
clear_btn.click(fn=lambda: None, inputs=None, outputs=sketchpad)
|
| 95 |
|
| 96 |
demo.launch(debug=True)
|
|
|
|
| 87 |
|
| 88 |
with gr.Column():
|
| 89 |
output_label = gr.Label(label="Prediction", num_top_classes=1)
|
| 90 |
+
output_bars = gr.BarPlot(
|
| 91 |
+
label="Confidence Scores",
|
| 92 |
+
x="Digit",
|
| 93 |
+
y="Probability",
|
| 94 |
+
vertical=False,
|
| 95 |
+
height=200
|
| 96 |
+
)
|
| 97 |
|
| 98 |
sketchpad.change(fn=predict_digit, inputs=sketchpad, outputs=[output_label, output_bars])
|
| 99 |
+
upload_btn.upload(fn=predict_digit, inputs=upload_btn, outputs=[output_label, output_bars])
|
| 100 |
clear_btn.click(fn=lambda: None, inputs=None, outputs=sketchpad)
|
| 101 |
|
| 102 |
demo.launch(debug=True)
|