A comprehensive real-time engagement monitoring system built with Streamlit that combines audio emotion detection and screen activity analysis.
Try the live demo: Streamlit Cloud Demo
Note: The cloud version runs in demo mode with simulated data due to browser security limitations.
- Real-time emotion detection from microphone input
- Engagement mapping based on emotional states
- Support for multiple emotion categories
- Confidence scoring
- Local only - Requires PyAudio and librosa
- Real-time screen capture and OCR
- Context detection (Programming, Reading, Video, etc.)
- Sentiment analysis of screen content
- Idle time tracking
- Chrome tab monitoring
- Local only - Requires system permissions
- Real-time metrics visualization
- Interactive charts and graphs
- Session analytics and insights
- Data export capabilities
- Productivity scoring
Pros:
- Easy to share and demo
- No local setup required
- Automatic deployment from GitHub
Cons:
- Audio features disabled (browser security)
- Screen capture not available
- Runs in simulation mode
Deploy to Cloud:
- Fork this repository
- Connect to Streamlit Cloud
- Deploy automatically
Pros:
- Full audio emotion detection
- Complete screen analysis
- Real-time monitoring
- Privacy-first (all data stays local)
Cons:
- Requires setup and dependencies
- Platform-specific requirements
- Python 3.8 or higher
- For full features (local only):
- Tesseract OCR
- Audio drivers
- System permissions for screen capture
-
Clone the repository:
git clone https://github.com/your-username/deploy-str.git cd deploy-str -
Install dependencies:
pip install -r requirements.txt
-
For full audio features:
# Install additional audio dependencies pip install pyaudio librosa soundfile # Install spaCy model python -m spacy download en_core_web_sm
-
Run the app:
streamlit run streamlit_app.py
# Run the automated setup
.\setup.ps1- Visit the live demo link
- Click "Demo Mode" buttons to generate simulated data
- Explore the dashboard and analytics features
- Export sample data to understand the format
- Configure Settings: Use the sidebar to enable/disable features
- Start Monitoring:
- Audio Tab: Click "Start Audio" for emotion detection
- Screen Tab: Click "Start Screen" for screen analysis
- View Data: Monitor real-time metrics in the Dashboard
- Analyze: Use Analytics tab for detailed insights
- Export: Download session data as CSV
The app automatically detects the environment:
- Cloud Mode: Simulated data and demo features
- Local Mode: Full audio and screen analysis
- Update Interval: Data refresh rate (1-10 seconds)
- Audio Window: Sample duration for emotion analysis
- Confidence Threshold: Minimum confidence for predictions
- Data Retention: Maximum data points to keep in memory
Session data includes:
timestamp: Unix timestampemotion: Detected emotion (local) or simulatedengagement: Engagement level (Engaged/Distracted)context: Screen context (Programming, Reading, etc.)sentiment: Content sentiment analysisproductivity_score: Calculated productivity percentage
streamlit_app.py # Main application
βββ components/
β βββ audio_monitor.py # Audio processing (with cloud fallback)
β βββ screen_monitor.py # Screen analysis (with cloud fallback)
βββ requirements.txt # Cloud-compatible dependencies
βββ packages.txt # System packages for Streamlit Cloud
βββ .streamlit/
βββ config.toml # Streamlit configuration
βββ secrets.toml # Cloud environment detection
- Core: Always available (Streamlit, pandas, plotly)
- Optional: Graceful degradation (audio, screen capture)
- Platform-specific: Conditional imports
# Install full dependencies
pip install -r requirements.txt
pip install pyaudio librosa soundfile
# Run with hot reload
streamlit run streamlit_app.py# Use cloud-compatible requirements only
pip install streamlit pandas numpy plotly opencv-python-headless
# Test cloud mode
CLOUD_DEPLOYMENT=true streamlit run streamlit_app.py- Import Errors: Check
requirements.txtfor cloud compatibility - Package Issues: Verify
packages.txtsystem dependencies - Memory Limits: Reduce data retention settings
- PyAudio Fails:
pip install pipwin pipwin install pyaudio
- Tesseract Not Found: Install and add to PATH
- Permission Denied: Run as administrator (Windows)
- Local Processing: All analysis done on your machine
- No Data Upload: Audio/screen data never leaves your device
- Cloud Demo: Uses only simulated data
- Optional Export: Manual data export only
- Fork the repository
- Create a feature branch
- Test both local and cloud compatibility
- Submit a pull request
MIT License - See LICENSE file for details
- Documentation: Check this README and inline comments
- Issues: Create GitHub issues for bugs
- Discussions: Use GitHub Discussions for questions
π Star this repository if you find it useful!