Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,14 @@ from PIL import Image
|
|
8 |
|
9 |
|
10 |
def fun(a):
|
11 |
-
Im=Image.fromarray(a).resize(48,48)
|
12 |
|
13 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
14 |
reloaded_model_eth = from_pretrained_keras('jmparejaz/Facial_eth_recognition')
|
15 |
#img=load_img(a, grayscale=True)
|
16 |
-
a=asarray(Im)
|
17 |
a=a.reshape(1, 48, 48, 1)
|
|
|
18 |
#reshape((-1,48,48,1))
|
19 |
pred=reloaded_model.predict(a)
|
20 |
pred_eth=reloaded_model_eth.predict(a)
|
|
|
8 |
|
9 |
|
10 |
def fun(a):
|
11 |
+
Im=Image.fromarray(a).resize((48,48))
|
12 |
|
13 |
reloaded_model = from_pretrained_keras('jmparejaz/Facial_Age-gender-eth_Recognition')
|
14 |
reloaded_model_eth = from_pretrained_keras('jmparejaz/Facial_eth_recognition')
|
15 |
#img=load_img(a, grayscale=True)
|
16 |
+
a=np.asarray(Im)
|
17 |
a=a.reshape(1, 48, 48, 1)
|
18 |
+
a=a/255
|
19 |
#reshape((-1,48,48,1))
|
20 |
pred=reloaded_model.predict(a)
|
21 |
pred_eth=reloaded_model_eth.predict(a)
|