dgith commited on
Commit
45bc705
·
verified ·
1 Parent(s): 2be770c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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(label="Confidence Scores", x_title="Digit", y_title="Probability")
 
 
 
 
 
 
91
 
92
  sketchpad.change(fn=predict_digit, inputs=sketchpad, outputs=[output_label, output_bars])
93
- upload_btn.upload(fn=lambda img: predict_digit(img), inputs=upload_btn, outputs=[output_label, output_bars])
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)