This project performs real-time emotion analysis on live camera feed using DeepFace, OpenCV, and Matplotlib. It captures frames from the camera, analyzes them for emotions, and displays the emotion probabilities in a dynamic bar chart.
- Analyzes emotions including anger, disgust, fear, happiness, sadness, surprise, and neutral.
- Displays real-time emotion analysis using Matplotlib.
- Easily customizable for different camera setups and applications.
- Python 3.9
- OpenCV (cv2)
- Matplotlib
- DeepFace
-
Clone the repository:
git clone https://github.com/Dat28060596/Emotion-Analysis
-
Install the required Python packages:
pip install -r requirements.txt
-
Connect your camera to your computer.
-
Run the
real_time_emotion_analysis.pyscript:python real_time_emotion_analysis.py
-
Observe the real-time emotion analysis displayed in the Matplotlib window.
-
Press 'q' to exit the application.
-
Camera Selection: If you have multiple cameras connected to your computer, you can change the camera index in the script (
camera = cv2.VideoCapture(0)). -
Emotion Analysis Model: The script uses DeepFace for emotion analysis. You can customize the model or parameters for more specific analysis requirements.
This project utilizes the DeepFace library for face analysis.
This project is licensed under the MIT License.
Feel free to use and modify this code according to your needs.