Implementation of Convolutional Neural Network
for recognize face emotion. we've train hundred times this model to get better accuracy.
git clone https://github.com/rizki4106/emotion-detector.git
cd emotion-detector && pip install tensorflow opencv
# main.py
from src.detector import DetectEmotion
# if gui true when you run this script
# it will show the gui
# if gui false you can't see anything but
# you can see the output just print it.
alg = DetectEmotion(gui=True)
# takes 2 arguments
# 1. file -> file path
# 2. media_type -> type of media ( image or video)
# for now just support image
res = alg.predict("img/team2.jpeg", "image")
print(res)
This models can predict 7 type of face emotion
name | label |
---|---|
angry | 0 |
disgusted | 1 |
fearful | 2 |
happy | 3 |
neutral | 4 |
sad | 5 |
suprised | 6 |
Thanks to ananthu017 for providing emotion dataset on kaggle. We've train this model using those data.