Spaces:
Runtime error
Runtime error
import gradio as gr | |
import tensorflow as tf | |
model = tf.keras.models.load_model("model.h5") | |
def sketch_recognition(img): | |
img = img.reshape(1, 28, 28, 1).astype('float32') / 255 | |
prediction = model.predict(img) | |
return int(tf.argmax(prediction, 1)) | |
gr.Interface(fn=sketch_recognition, inputs="sketchpad", | |
outputs="label").launch() | |