Spaces:
Runtime error
Runtime error
import gradio as gr | |
from huggingface_hub import from_pretrained_keras | |
import numpy as np | |
import logging | |
#reloaded_model_eth = from_pretrained_keras('jmparejaz/Facial_eth_recognition') | |
def rgb2gray(rgb): | |
return np.dot(rgb[...,:3], [0.2989, 0.5870, 0.1140]) | |
def fun(a): | |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition') | |
#img=load_img(a, grayscale=True) | |
logging.info("%s, %s "%(a.shape[0],a.shape[1]) | |
pred=reloaded_model.predict(a) | |
return pred | |
gr.Interface(fn=fun, inputs="image", outputs=["label","text"]).launch() |