Spaces:
Runtime error
Runtime error
File size: 611 Bytes
4ec72e6 d2cb493 ca47061 a7f8465 b4243e9 d143ef5 a7f8465 4ec72e6 0fe6a90 d4ac851 4374108 d2cb493 f3c2291 4374108 436851c 4ec72e6 430bc33 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
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)
a=a.reshape((-1,48,48,1))
pred=reloaded_model.predict(a)
return pred[0][0][0],pred[1][0][0],
gr.Interface(fn=fun, inputs=gr.inputs.Image(shape=(48,48)), outputs=["text","text"]).launch() |