This project uses OpenCV and DeepFace to detect faces and analyze emotions in real-time from a webcam feed. The program captures video frames, detects faces, and overlays the detected emotions on the video.
- 🧑🤝🧑 Face Detection: Detects faces using OpenCV's Haar Cascade Classifier.
- 😄 Emotion Analysis: Uses DeepFace to analyze emotions from the detected faces.
- 🎥 Real-Time Video Feed: Displays live webcam feed with detected emotions.
- 🖥️ Simple Interface: Real-time feedback with emotion labels on the video.
- Programming Language: Python
- Face Detection: OpenCV (Haar Cascade Classifier)
- Emotion Recognition: DeepFace
- Computer Vision Library: OpenCV
- Webcam Access: OpenCV VideoCapture
-
Clone the Repository
git clone https://github.com/your-username/face-emotion-detection.git cd face-emotion-detection -
Install Dependencies
- Install required Python libraries:
pip install opencv-python deepface
-
Run the Application
python face2.py
- The program will start capturing video from the webcam, and display the dominant emotion detected from the face in real-time.
- Face Detection: Uses OpenCV's pre-trained Haar Cascade classifier to detect faces in the video frames.
- Emotion Recognition: The DeepFace library is used to analyze the emotions on the detected faces, providing a list of emotions and identifying the dominant one.
- Real-time Display: The dominant emotion is displayed on the video feed, and faces are highlighted with a rectangle.
- Python: Version 3.6 or higher
- Libraries:
- OpenCV
- DeepFace
- DeepFace for emotion analysis.
- OpenCV for face detection and video processing.