Emotion / app.py
sudhir2016's picture
Update app.py
4acffb0
raw
history blame
362 Bytes
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')
iface.launch()