crobbi commited on
Commit
d4055fd
1 Parent(s): 38cd9ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -8
app.py CHANGED
@@ -1,13 +1,16 @@
1
  import gradio as gr
2
  import pickle
3
  import numpy as np
4
- model = pickle.load(open("model.pkl","rb"))
5
 
6
- def predict_v(input_value):
7
  try:
8
- if input_value == None: pass
9
- except:
10
- return np.argmax(model.predict(input_value / 255.))
11
- gr.Interface(fn=predict_v,
12
- inputs = gr.SketchPad(),
13
- outputs="number").launch()
 
 
 
 
 
1
  import gradio as gr
2
  import pickle
3
  import numpy as np
 
4
 
5
+ def test(k):
6
  try:
7
+ if k == None:
8
+ pass
9
+ except:
10
+ print(k.shape)
11
+ k = k / 255.
12
+ return np.argmax(model.predict(k))
13
+ gr.Interface(inputs=gr.Sketchpad(),
14
+ outputs="number",
15
+ fn=test,
16
+ live=True).launch()