Spaces:
Runtime error
Runtime error
import numpy as np | |
import gradio as gr | |
from tensorflow import keras | |
from huggingface_hub import from_pretrained_keras | |
model = from_pretrained_keras("ISYS/MyNewModel") | |
def greet(img): | |
img = np.expand_dims(img, axis=0) | |
#return np.argmax(model.predict(img)[0]) | |
numb = np.argmax(model.predict(img)[0]) | |
return numb % 3 | |
def rasp_numb(img): | |
img = np.expand_dims(img, axis=0) | |
return np.argmax(model.predict(img)[0]) | |
output1 = gr.outputs.Text((np.argmax(model.predict(img)[0])% 3) ) | |
output2 = gr.outputs.Text(np.argmax(model.predict(img)[0])) | |
demo = gr.Interface(fn=greet, inputs="sketchpad", outputs=[output1, output2]) | |
demo.launch() |