The MoodLyft Mirror is an advanced emotion detection project that leverages AI to:
- Recognize emotions in real-time through facial analysis.
- Provide uplifting and personalized compliments based on detected emotions.
- Utilize a sleek and modern UI to enhance user experience.
"Enhance your day by visualizing and understanding your emotions!"
- โจ Features
- ๐ฆพ Tech Stack
- ๐ธ Screenshots
- ๐จโ๐ง Setup Instructions
- ๐ฏ Target Audience
- ๐ค Contributing
- ๐ License
- Real-time emotion recognition using advanced AI algorithms with MTCNN face detection
- Displays dominant emotions like happiness, sadness, anger, surprise, fear, and disgust
- Confidence levels and emotion history tracking
- Intelligent frame skipping for optimal performance
- Intelligent compliments tailored to your mood with 5+ variations per emotion
- Advanced text-to-speech (TTS) with voice selection and non-blocking audio
- Smart cooldown system for natural interaction timing
- Emoji integration for enhanced visual feedback
- Sleek, translucent interface with modern glassmorphism effects
- Smooth animations including pulsing borders and color transitions
- Dynamic gradient backgrounds that respond to emotions
- Real-time performance metrics with color-coded FPS display
- Animated confidence bars and emotion history graphs
- Intelligent frame processing with configurable skip rates
- Threaded audio processing for smooth operation
- Auto-hardware detection with optimized presets
- Memory management with circular buffers
- Cross-platform font optimization
- Python: Core programming language.
- OpenCV: For real-time video processing and face detection.
- FER: Facial Expression Recognition library for emotion analysis.
- Pillow: For enhanced text rendering and UI effects.
- Pyttsx3: For advanced TTS functionality with voice selection
- NumPy: For numerical operations and efficient data processing
- SciPy: For advanced mathematical computations and optimizations
- Matplotlib: For real-time emotion history visualization
- Psutil: For system monitoring and auto-performance tuning
- Python 3.11 or higher installed on your system.
- A webcam for real-time emotion detection.
- Install required Python packages listed in
requirements.txt
.
-
Clone the Repository
git clone https://github.com/alienx5499/MoodLyft-Mirror-RealTime-Emotion-Analyzer-RealTime-Emotion-Analyzer.git cd MoodLyft-Mirror-RealTime-Emotion-Analyzer
-
Set Up a Virtual Environment Setting up a virtual environment ensures that your project's dependencies are isolated from your global Python installation, preventing version conflicts and promoting a clean development environment.
For macOS/Linux
- Create a virtual environment:
python3 -m venv moodlyft_env
- Activate the virtual environment:
source moodlyft_env/bin/activate
For Windows
- Create a virtual environment:
python3 -m venv moodlyft_env
- Activate the virtual environment:
moodlyft_env\Scripts\activate
-
Install Dependencies For macOS/Linux
pip install -r requirements-macos.txt
For Windows
pip install -r requirements-windows.txt
-
Run the Setup Script (Recommended)
python setup.py
This will automatically detect your system and apply optimal settings
OR manually run the application:
python main.py
-
Experience the App
- Ensure your webcam is connected and accessible
- Use keyboard controls: 'q' to quit, 's' for screenshot, 'r' to reset history
- Try the interactive demo:
python demo.py
The application automatically detects your hardware and applies optimal settings. You can customize performance in config.py
:
# Performance presets available:
from config import HardwarePresets
HardwarePresets.high_performance() # For powerful systems
HardwarePresets.balanced() # Default balanced mode
HardwarePresets.performance_mode() # For older hardware
HardwarePresets.battery_saver() # For laptops/mobile
Key | Action |
---|---|
q |
Quit application |
s |
Save screenshot |
r |
Reset emotion history |
Metric | Original | Optimized | Improvement |
---|---|---|---|
FPS | 15-20 | 25-30 | +40-50% |
Memory Usage | ~300MB | ~200MB | -33% |
CPU Usage | ~40% | ~25% | -37% |
TTS Blocking | Yes | No | Non-blocking |
- Individuals: Track your mood and uplift your spirits daily.
- Therapists: Utilize emotion detection as part of therapy sessions.
- Developers: Enhance and expand the project with additional features.
We โค๏ธ open source! Contributions are welcome to make this project even better.
- Fork the repository.
- Create your feature branch.
git checkout -b feature/new-feature
- Commit your changes.
git commit -m "Add a new feature"
- Push to the branch and open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
We value your input! Share your thoughts through GitHub Issues.
๐ก Let's work together to uplift emotions and create positivity!