File size: 630 Bytes
30ac140
8e9e307
e8a3fe7
30ac140
9105c18
 
30ac140
 
 
d0502ed
8a24814
 
 
30ac140
2ed30b2
9a5af09
 
 
8a24814
 
 
 
2e48875
8a24814
2e48875
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
demo.launch()