Spaces:
Sleeping
Sleeping
Commit
•
18bfb9c
1
Parent(s):
93aa27c
Upload 2 files
Browse files- app.py +13 -0
- requirements.txt +5 -0
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
+
from tensorflow import keras
|
4 |
+
|
5 |
+
model = keras.models.load_model('my_model')
|
6 |
+
|
7 |
+
def predict(img):
|
8 |
+
img = np.expand_dims(img, axis=0)
|
9 |
+
return np.argmax(model.predict(img)[0])
|
10 |
+
|
11 |
+
demo = gr.Interface(fn=predict, inputs='sketchpad', outputs="text")
|
12 |
+
|
13 |
+
demo.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
keras
|
2 |
+
numpy
|
3 |
+
gradio
|
4 |
+
huggingface_hub
|
5 |
+
tensorflow
|