This project is a real-time emotion detection system that captures emotions through your Webcam, recognizes various facial expressions (like happy, sad, angry, etc.), and speaks out the detected emotion using text-to-speech.
- Detects seven emotions: happy, sad, angry, fear, surprise, disgust, and neutral.
- Real-time webcam feed with bounding boxes around detected faces.
- Speaks the detected dominant emotion using the text-to-speech feature.
- Displays confidence levels for all emotions detected on screen.
example of detecting and speaking emotions in real-time.
Make sure you have Python 3.6+ installed on your system. You can download it from python.org.
You need the following Python libraries to run the project:
opencv-python
fer
pyttsx3
tensorflow
(required forfer
)
You can install these using pip
:
pip install opencv-python fer pyttsx3 tensorflow
-
Clone this repository to your local machine:
git clone: https://github.com/zouraiz523/Real-Time-Emotion-Detector-with-Voice-Feedback.git
-
Navigate to the project directory:
cd real-time-emotion-detector
-
Run the Python script:
python emotion_detector.py
-
Allow access to your webcam, and the emotion detection will start in real-time!
- The application will open a window displaying your webcam feed.
- It will recognize emotions in real-time and draw a bounding box around each detected face.
- The dominant emotion will be displayed above each face.
- The program will speak the detected emotion out loud.
- Press 'q' to quit the program.
.
├── emotion_detector.py # Main script to run the emotion detection
├── README.md # Project documentation
└── requirements.txt # List of required dependencies
- Add support for more emotions by using advanced machine learning models.
- Improve speech by adding more voice options and customizing text-to-speech speed and tone.
- Integrate face recognition to map emotions to specific individuals.
Contributions are welcome! If you have any ideas or improvements, feel free to create a pull request. Please make sure your contributions are well-documented and tested.
- Fork the project.
- Create your feature branch:
git checkout -b feature/your-feature
. - Commit your changes:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature/your-feature
. - Open a pull request.