Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from huggingface_hub import from_pretrained_keras
|
3 |
import numpy as np
|
4 |
-
|
5 |
|
6 |
|
7 |
|
@@ -14,9 +14,7 @@ def rgb2gray(rgb):
|
|
14 |
def fun(a):
|
15 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
16 |
inp = a.reshape((-1, 48, 48, 3))
|
17 |
-
|
18 |
-
return ("%s"%inp)
|
19 |
|
20 |
|
21 |
-
|
22 |
-
gr.Interface(fn=fun, inputs=gr.Image(shape=(48, 48)), outputs="text").launch()
|
|
|
1 |
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 |
|
|
|
14 |
def fun(a):
|
15 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
16 |
inp = a.reshape((-1, 48, 48, 3))
|
17 |
+
return Image.fromarray(inp)
|
|
|
18 |
|
19 |
|
20 |
+
gr.Interface(fn=fun, inputs=gr.Image(shape=(48, 48)), outputs="Image").launch()
|
|