File size: 389 Bytes
e64a2dd
 
d7f59f3
7da3c47
7e24825
4acffb0
 
 
7e24825
50f3f58
e64a2dd
 
1
2
3
4
5
6
7
8
9
10
11
12
import gradio
import cv2
from deepface import DeepFace
def infer(img):
    result=DeepFace.analyze(img,actions=['emotion','gender'])
    emo=result[0].get('dominant_emotion')
    gen=result[0].get('dominant_gender')
    final=('Gender '+gen+', Emotion '+emo)
    return final
iface = gradio.Interface(fn=infer, inputs='image', outputs='text',examples=['Mona_Lisa.jpg'])
iface.launch()