{"id":17893021,"url":"https://github.com/yashk2000/emotion-detector","last_synced_at":"2025-04-03T03:46:11.676Z","repository":{"id":119125076,"uuid":"238498823","full_name":"yashk2000/Emotion-Detector","owner":"yashk2000","description":"A CNN based emotion detector","archived":false,"fork":false,"pushed_at":"2020-06-22T16:34:51.000Z","size":5678,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-08T18:09:41.420Z","etag":null,"topics":["cnn-keras","computer-vision","convolutional-neural-networks","emotion-detector","emotion-recognition","opencv-python","python-3"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/yashk2000.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":"2020-02-05T16:41:11.000Z","updated_at":"2020-06-22T16:34:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"9917552c-35f0-490c-8784-af107256c432","html_url":"https://github.com/yashk2000/Emotion-Detector","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/yashk2000%2FEmotion-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashk2000%2FEmotion-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashk2000%2FEmotion-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yashk2000%2FEmotion-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yashk2000","download_url":"https://codeload.github.com/yashk2000/Emotion-Detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933355,"owners_count":20857052,"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","computer-vision","convolutional-neural-networks","emotion-detector","emotion-recognition","opencv-python","python-3"],"created_at":"2024-10-28T14:46:57.576Z","updated_at":"2025-04-03T03:46:11.655Z","avatar_url":"https://github.com/yashk2000.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Emotion-Detector\nThis is a CNN based emotion detector.\n\nIt can detect 6 facial expressions:\n\n- Angry\n- Disgust\n- Fear\n- Happy\n- Sad\n- Surprise\n- Neutral\n\nThe CNN has been trained on the [FER2013](https://www.kaggle.com/c/challenges-in-representation-learning-facial-expression-recognition-challenge/data) dataset available on Kaggle. \n\n# 1) Building the dataset: \n\nTo build the dataset, run `buildDataset.py` to build the dataset. Provide the path to the dataset inside the file.\n\n```bash\npython buildDataset.py\n```\n\n# 2) Training:\n\nTo train the CNN, use the `trainRecognizer.py` class. You can train the model using checkpoints. When the model seems to be overfitting or underfitting, pause the training, adjust the script and resume training from the same checkpoint. \n\n```bash\npython trainRecognizer.py --checkpoints checkpoints\n```\n\nTo resume from the epoch where the training wa stopped: \n\n```bash\npython trainRecognizer.py --checkpoints checkpoints --model checkpoints/epoch_40.hdf5 --start-epoch 40\n```\n\n# 3) Testing the model:\n\nI used the model obtained at epoch 75 for all purposes. To test the model run `testRecognizer.py`. \n\n```bash\npython test_recognizer.py --model checkpoints/epoch_75.hdf5\n```\n\n# 4) Using the model on a real time feed:\n\nTo detect emotions in a real time feed from the camera, use the `emotionDetector.py` script. In order to detect multiple faces use the `emotionDetectorMultipleFaces.py` script. \n\n```bash\npython emotionDetector.py --cascade haarcascade_frontalface_default.xml --model checkpoints/epoch_75.hdf5\npython emotionDetectorMultipleFaces.py --cascade haarcascade_frontalface_default.xml --model checkpoints/epoch_75.hdf5\n```\n\nResults:\n\n![Screenshot from 2020-04-29 23-48-40](https://user-images.githubusercontent.com/41234408/80632071-5085b200-8a74-11ea-8eae-eeccd0277ecb.png)\n\nPS: I think I am a robot and therefore the only emotion I have is neutral and it's the only screenshot I was able to upload. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashk2000%2Femotion-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyashk2000%2Femotion-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyashk2000%2Femotion-detector/lists"}