sudhir2016 commited on
Commit
7e24825
·
1 Parent(s): 8318e99

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -2,9 +2,11 @@ import gradio
2
  import cv2
3
  from deepface import DeepFace
4
  def infer(img):
5
- result=DeepFace.analyze(img,actions=["emotion"])
6
- result1=result[0].get('dominant_emotion')
7
- return result1
 
 
8
  iface = gradio.Interface(fn=infer, inputs='image', outputs='text')
9
  iface.launch()
10
 
 
2
  import cv2
3
  from deepface import DeepFace
4
  def infer(img):
5
+ result=DeepFace.analyze(img,actions=['emotion','gender'])
6
+ gen=result[0].get('dominant_emotion')
7
+ emo=result[0].get('dominant_gender')
8
+ final=('Gender '+gen+' Emotion '+emo)
9
+ return final
10
  iface = gradio.Interface(fn=infer, inputs='image', outputs='text')
11
  iface.launch()
12