TakeshiSaito commited on
Commit
dac00a9
1 Parent(s): 260bf3d
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -49,11 +49,15 @@ def predict(image):
49
  return predicted.item()
50
 
51
 
52
- input_component = gr.Sketchpad(type='pil')
53
- input_component.height = 280
54
- input_component.width = 280
55
- input_component.brush.default_color = 'white'
56
- gr.Interface(fn=predict,
57
- inputs=input_component,
58
- outputs="text",
59
- live=True).launch()
 
 
 
 
 
49
  return predicted.item()
50
 
51
 
52
+ input_component = gr.Sketchpad(type='pil',
53
+ height=280,
54
+ width=280,
55
+ layers=False,
56
+ image_mode='L',
57
+ brush=gr.Brush(default_color='auto', color_mode='defaults'))
58
+ iface = gr.Interface(fn=predict,
59
+ inputs=input_component,
60
+ outputs="text",
61
+ live=True,
62
+ clear_btn=gr.ClearButton(visible=False))
63
+ iface.launch()