Spaces:
Runtime error
Runtime error
Download app.py from sudhir2016/Emotion: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/spaces/sudhir2016/Emotion/resolve/main/app.py
- Command line
-
hf download hf://spaces/sudhir2016/Emotion/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sudhir2016/Emotion/resolve/main/app.py
385 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',examples=['Happy.jpg']) | |
| iface.launch() | |