This Python script uses computer vision and deep learning techniques to perform real-time face detection and emotion recognition using a convolutional neural network (CNN) model.
Make sure you have the following libraries installed:
- NumPy
- Matplotlib
- OpenCV (cv2)
- TensorFlow
- PyWavelets (pywt)
You can install these dependencies using the following:
pip install numpy matplotlib opencv-python tensorflow pywavelets
- Clone the repository
git clone https://github.com/yourusername/your-repo.git cd your-repo
- Run the face_detect.py script:
python face_detect.py
The script will open your webcam and perform face detection and emotion recognition in real-time.
The model classifies emotions into the following classes:
- Angry
- Fear
- Happy
- Neutral
- Sad
- Surprise
Additional Notes: The emotion prediction is displayed in real-time on the webcam feed. Press 'q' to exit the application.
- Download the training and validation dataset from here