MyNewSpace / app.py
ISYS's picture
333
aea3784
raw
history blame
662 Bytes
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])
a = numb % 3
return a, numb
def rasp_numb(img):
img = np.expand_dims(img, axis=0)
return np.argmax(model.predict(img)[0])
outputs = [
gr.Textbox(label="hexadecimal color"),
gr.Textbox(label="hexadecimal color")
]
demo = gr.Interface(fn=greet, inputs="sketchpad", output=outputs)
if __name__ == "__main__":
demo.launch()