Welcome to the Emotion Detection module of MockPitch 2! This tool uses your webcam to see your face and guess what you're feeling. Are you happy, sad, surprised, or something else? Let's find out!
This module uses a powerful deep learning model that has been trained on thousands of images of faces. It analyzes your facial expressions in real-time to predict one of seven emotions:
- 😠 Angry
- 🤢 Disgust
- 😨 Fear
- 😄 Happy
- 😐 Neutral
- 😢 Sad
- 😲 Surprise
Ready to see your emotions come to life? Here's how to get this module running.
Navigate to this directory in your terminal:
cd "c:\College Assignment\MockPitch 2\Emotion"We need to create a special, isolated space for this project's Python packages.
python -m venv .venvNow, let's step into that isolated space.
# On Windows
.venv\Scripts\activateTime to install all the necessary libraries. This project has a special requirements2.txt file.
pip install -r requirements2.txtLet's see those emotions! Run the test_model.py script.
python test_model.pyA window will pop up, and the console will show the detected emotion. The script will also log the output to a CSV file.
This module logs the detected emotions to a file named emotion_output.csv. Each time you run the script, a new log file is created. The CSV file contains the following columns:
- timestamp: The Unix timestamp of the log entry.
- emotion: The detected emotion at that timestamp.