{"id":16108272,"url":"https://github.com/shashikg/emotionrecognition","last_synced_at":"2025-07-07T16:34:15.138Z","repository":{"id":98115344,"uuid":"160780165","full_name":"shashikg/EmotionRecognition","owner":"shashikg","description":"Detects Real Time Human Facial Emotions Trained on ICML 2013 dataset of Facial Expression Recognition Challenge on kaggle.","archived":false,"fork":false,"pushed_at":"2020-06-13T20:12:55.000Z","size":63281,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-27T04:33:26.828Z","etag":null,"topics":["cnn-keras","convolutional-neural-networks","emotion-detection","emotion-recognition","facial-expression-recognition","machine-learning","opencv"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shashikg.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-07T06:18:48.000Z","updated_at":"2024-05-08T06:13:25.000Z","dependencies_parsed_at":"2023-05-23T20:45:40.513Z","dependency_job_id":null,"html_url":"https://github.com/shashikg/EmotionRecognition","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashikg%2FEmotionRecognition","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashikg%2FEmotionRecognition/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashikg%2FEmotionRecognition/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shashikg%2FEmotionRecognition/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shashikg","download_url":"https://codeload.github.com/shashikg/EmotionRecognition/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248721131,"owners_count":21151050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cnn-keras","convolutional-neural-networks","emotion-detection","emotion-recognition","facial-expression-recognition","machine-learning","opencv"],"created_at":"2024-10-09T19:26:13.853Z","updated_at":"2025-04-13T13:32:47.853Z","avatar_url":"https://github.com/shashikg.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real Time Human Emotion Recognition\nThis repo contains files related to my project on emotion recognition carried during the end of my 5th semester as a hobby project. Presently, its capable of extracting faces from a web cam stream and classify them into 7 different moods i.e. Angry, Disgust, Fear, Happy, Sad, Surprise and Neutral. The face detection module uses already trained Haar-Cascade/ dnn based face detector from OpenCV. And Classifier was trained on the **ICML 2013** dataset of [Facial Expression Recognition Challenge](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge) on kaggle.\n\n\u003cp align=\"center\"\u003e\u003cimg src='img/happy-demo.png'/)\u003c/p\u003e\n\n**Link to Demo Video:** [https://youtu.be/XVQSMbeBGZQ](https://youtu.be/XVQSMbeBGZQ)\n\n## Training Results\n**Accuracy Achieved on Test Data:** 65.34 %\n\u003c!-- **Confusion Matrix:** --\u003e\n\u003cp align=\"center\"\u003e\u003cimg src='img/cm.png'/\u003e\u003c/p\u003e\n\n## Proposed Neural Network Architecture\n\u003cp align=\"center\"\u003e\u003cimg src='img/nn_architecture.png'/\u003e\u003c/p\u003e\n\n## Usage\nDownload the **Dataset** from [here](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge) and put **fer2013.csv** inside the data folder. Then install all the dependencies in a virtual environment\n```\n$ virtualenv --system-site-packages -p python3 ./venv\n$ source ./venv/bin/activate\n$ pip install -r requirements.txt\n```\nThen run the following commands to test the module\n```\n# To train a new model\n$ python emotion_trainer.py\n\n# To run the emotion recognition module\n$ python emotion_recogniser.py\n```\n### Selecting face-detector\nIn **emotion_recogniser.py** change the following line as per your choice:\n```\n# for dnn based use this\nfaces = get_faces(img, method='dnn')\n```\n```\n# for haar-cascade based use this\nfaces = get_faces(img, method='haar')\n```\n\n## Directory Structure\n```\n├── saved_model\n│   └── cnn0.h5 ..................................:: Trained CNN model\n│   └── cnn1.h5 ..................................:: Trained CNN model on mirror images\n│   └── ensemble.h5 ..............................:: Trained NN Model on prediction from above two\n│   └── haarcascade_frontalface_default.xml ......:: OpenCV Haar-Cascade model for frontfaces\n│   └── opencv_face_detector_uint8.pb ............:: OpenCV trained model for faces\n│   └── haarcascade_frontalface_default.xml ......:: OpenCV trained model for faces\n├── detectfaces.py ...............................:: Contains function to call face detector and\n│                                                    crop \u0026 resize the detected faces to 48x48 size\n├── emotion_trainer(.py/ .ipynb) .................:: This will train the designed Neural Network model on the given dataset\n├── emotion_recogniser.py ........................:: This is the main program which will show real-time emotion classification\n│                                                    using the models saved in the directory 'saved_model/'\n├── plot_confusion_matrix.py .....................:: Used to generate the confusion matrix of the trained model\n├── img/ .........................................:: Contains some images related to results and for testing\n├── requirements.txt\n└── README.md\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashikg%2Femotionrecognition","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshashikg%2Femotionrecognition","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshashikg%2Femotionrecognition/lists"}