A Python-based smart mirror application that combines computer vision, artificial intelligence, and natural language processing to create an interactive experience. The system detects people in real-time, analyzes their appearance using a combination of YOLOv11, Llama 3.2 (via Lambda Labs), and OpenAI's GPT-4o-Mini, and delivers witty responses through speech synthesis, while also providing useful information like weather updates. We're also pulling weather data from OpenWeather API and displaying it on the mirror to demonstrate how to integrate external APIs.
- OpenAI GPT-4o: Powers image analysis and generates contextual responses
- OpenCV: Handles real-time computer vision and person detection
- YOLOv11: Provides real-time person detection with high accuracy
- PyTorch: Supports deep learning models for advanced computer vision tasks
- Discord Bot: Remote control, monitoring, and image sharing capabilities
- OpenWeather API: Real-time weather information and condition-aware fashion advice
- Text-to-Speech: GPT-4o-Mini-Audio_preview for voice output
- Lambda Labs: Powers Llama 3.2 for advanced text generation
- Real-time person tracking using YOLOv11
- Adjustable confidence threshold (using '[' and ']' keys)
- Configurable center detection region (using '-' and '+' keys)
- Automatic person presence tracking with cooldown timer
Five different critic personalities available (switch using number keys 1-5):
- Kind & Child-Friendly: Supportive and encouraging feedback
- Professional & Balanced: Constructive professional styling advice
- Weather-Aware: Context-aware fashion suggestions based on current weather
- Ultra-Critical Expert: High-standard professional critique
- Savage Roast Master: Dramatic and theatrical fashion commentary
- SPACE: Force trigger next roast
- BACKSPACE: Skip current roast
- Q: Quit application
- C: Clear audio playback
- 1-5: Switch between critic styles
- [ ]: Adjust detection confidence
- - +: Adjust center region size
- Automatic sharing of fashion critiques with images
- Remote monitoring capabilities
- Dedicated channel for mirror interactions
- Real-time weather condition monitoring
- Weather-aware fashion advice
- Temperature and condition-specific recommendations
mirror.py: Main application entry point and core logicdiscord_bot.py: Discord integration for remote monitoringweather_service.py: OpenWeather API integrationprompt_manager.py: AI prompt management and personality systems
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-sourced under the MIT License - as per the rules of the MIT Reality Hack rules. For more information, please check out the MIT Reality Hack Rules.
- OpenAI for GPT-4 Vision API
- OpenCV community
- Discord.py developers
- OpenWeather API team
- Ultralytics for YOLOv11
- Lambda Labs for Lambda API + Free GPU credits
- Webcam or camera input device (we are using the Qualcomm RB3 Gen 2 Developer Kit (Vision Kit)
- Display monitor
- Microphone (optional, for voice commands)
- Speakers or audio output device
- This project is built to run on lightweight edge compute devices, such as the Qualcomm RB3 Gen 2 Developer Kit (Vision Kit), Raspberry Pi, Mac Mini, and more.
- Python (Tested working on version 3.11)
- Operating system: Windows 10+, macOS 10.15+, or Linux (Ubuntu 20.04+ recommended)
- OpenAI API key (for GPT-4 Vision)
- Discord Bot Token (optional, for remote control)
- OpenWeather API key (for weather services)
git clone https://github.com/tekierz/RH25-Table62.git
cd RH25-Table62python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txtpython3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt- Copy the
.env_templatefile to.env - Fill in your API keys and configuration:
OPENAI_API_KEY=your_api_key_here DISCORD_TOKEN=your_discord_token_here DISCORD_CHANNEL_ID=your_discord_channel_id_here OPEN_WEATHER_API_KEY=your_open_weather_api_key_here WEATHER_LAT=your_latitude_here WEATHER_LON=your_longitude_here
- Install the appropriate PyTorch version from pytorch.org
- Install Homebrew (if not already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - Install required system dependencies:
brew install python cmake pkg-config
sudo apt-get update
sudo apt-get install -y python3-dev python3-pip
sudo apt-get install -y libopencv-dev python3-opencv
sudo apt-get install -y portaudio19-dev python3-pyaudio- Activate the virtual environment (if not already activated)
- Start the main application:
python mirror.py