A Python application which detects a Human face using the Haar Cascade Algorithm and categorized the emotion into one of the following emotion Happy, Neutral, Sad, Angry and Surprise. For Image analysis DeepFace provides additional attributes such as Age, Gender, Emotion and Race.
- Inorder to move forward with the Installation we must have Python 3.8.5 or
aboveinstalled on our system. - After installation of Python, install pip using the following this link
- If you have more than one python versions installed type
python3in place ofpythonandpip3in place ofpip. Check python version using the following command:
$ python --version - This command will give you the list of installed python versions
requirements.txtfile contains all the packages required- To install run the following command in your terminal:
$ pip install -r requirements.txt- This may take a few minutes to complete the installation process.
- This application does not have a GUI available yet, so it uses the standard Command line interface.
file_handler.pyis responsible for taking care of the user input. - To run the program run the following command in your terminal:
$ python file_handler.py- It will take some time to start, then it will give the options to select a input format. for selecting an image or video a finder window will pop-up and for live video feed the program will launch the webcam
take2_train.pyfile contains the logic to train the model. To create the model follow the command below:
$ python logic/take2_train.py- To train the model it can take few minutes to an hour depending on your system.
epochsdefines training the neural network with all the training data for one cycle I have tried with different values and25seems to worked the best with my project. - you can set the epochs in
take2_train.pyand also rename your model name - Face detection Cascade for face detection and the used Dataset
- More information on the model