jmparejaz commited on
Commit
f7b9e32
·
1 Parent(s): 99646be

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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
- inp = a.reshape((-1, 48, 48, 3))
17
- return a
 
 
18
 
19
 
20
- gr.Interface(fn=fun, inputs=gr.Image(shape=(48, 48)), outputs="image").launch()
 
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()