Andysoeasy commited on
Commit
9c1d431
·
1 Parent(s): dcbe415

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import numpy as np
2
+ import keras
3
+ import gradio as gr
4
+
5
+ from huggingface_hub import from_pretrained_keras
6
+
7
+ model = from_pretrained_keras("Andysoeasy/digit_defines")
8
+
9
+
10
+ def greet(img):
11
+ img = np.expand_dims(img, axis = 0)
12
+ return np.argmax(model.predict(img)[0])
13
+
14
+
15
+ demo = gr.Interface(fn = greet,
16
+ inputs = 'sketchpad',
17
+ outputs = 'text')
18
+ demo.launch()