Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
from huggingface_hub import from_pretrained_keras
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
-
|
6 |
|
7 |
|
8 |
|
@@ -13,8 +13,10 @@ def rgb2gray(rgb):
|
|
13 |
|
14 |
def fun(a):
|
15 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
16 |
-
|
17 |
-
|
|
|
|
|
18 |
|
19 |
|
20 |
-
gr.Interface(fn=fun, inputs=
|
|
|
2 |
from huggingface_hub import from_pretrained_keras
|
3 |
import numpy as np
|
4 |
from PIL import Image
|
5 |
+
from tensorflow.keras.utils import load_img
|
6 |
|
7 |
|
8 |
|
|
|
13 |
|
14 |
def fun(a):
|
15 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
16 |
+
img=load_img(a, grayscale=True)
|
17 |
+
|
18 |
+
#inp = a.reshape((-1, 48, 48, 3))
|
19 |
+
return img
|
20 |
|
21 |
|
22 |
+
gr.Interface(fn=fun, inputs="image", outputs="image").launch()
|