File size: 312 Bytes
3ffa9cb
 
 
 
5a7c06c
3ffa9cb
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import gradio as gr
import numpy as np
from tensorflow import keras

model = keras.models.load_model('/home/user/app/my_model')

def greet(img):
    img = np.expand_dims(img, axis=0)
    return np.argmax(model.predict(img)[0])

demo = gr.Interface(fn=greet, inputs="sketchpad", outputs="text")

demo.launch()