Update app.py
Browse files
app.py
CHANGED
@@ -28,6 +28,13 @@ test=test_images[0].reshape(-1,28,28)
|
|
28 |
pred=model.predict(test)
|
29 |
print(pred)
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
iface = gr.Interface(predict_image, inputs="sketchpad", outputs="label")
|
32 |
|
33 |
iface.launch(debug='True')
|
|
|
28 |
pred=model.predict(test)
|
29 |
print(pred)
|
30 |
|
31 |
+
def predict_image(img):
|
32 |
+
img_3d=img.reshape(-1,28,28)
|
33 |
+
im_resize=img_3d/255.0
|
34 |
+
prediction=model.predict(im_resize)
|
35 |
+
pred=np.argmax(prediction)
|
36 |
+
return pred
|
37 |
+
|
38 |
iface = gr.Interface(predict_image, inputs="sketchpad", outputs="label")
|
39 |
|
40 |
iface.launch(debug='True')
|