AI-Powered Real-Time Posture Monitoring & Coaching System
Edgefit-Coach is a comprehensive posture monitoring application built for the Qualcomm Edge AI Developer Hackathon. It combines real-time computer vision, AI coaching, and interactive dashboards to help users maintain healthy posture while working.
๐ View Complete Project Presentation: EdgeFit Coach.pdf
Comprehensive overview with architecture diagrams, features, and technical specifications
๐ฅ Watch Live Demo: Live Demo Presentation.mp4
Real-time demonstration of posture monitoring, AI coaching, and system features
- Real-Time Posture Detection: Advanced MediaPipe-based pose estimation with ONNX optimization
- AI-Powered Coaching: Intelligent motivational quotes and personalized feedback
- Stretching Exercise Detection: Automatic recognition of overhead reach and side stretch exercises
- Desktop Notifications: Cross-platform notifications (Windows Toast, Linux notify2)
- Interactive Dashboard: Comprehensive analytics with 6 key posture metrics
- Chat Interface: AI-powered health coaching conversations
- WebSocket Streaming: Real-time data updates and motivation quotes
- Posture Health Score: Overall posture quality (0-100%)
- Slouch-to-Good Conversions: Improvement tracking
- Consistency Index: Posture stability measurement
- Session Success Rate: Performance over time
- Recent Trend Score: Short-term progress tracking
- Total Good Posture Minutes: Cumulative healthy posture time
- FastAPI Backend: High-performance REST API with automatic documentation
- Streamlit Frontend: Interactive web interface for testing and monitoring
- WebSocket Support: Real-time bidirectional communication
- ONNX Runtime: Optimized model inference for edge devices
- Cross-Platform: Windows and Linux support
- Headless Operation: Can run without GUI for server deployments
- Python 3.8+
- Webcam/Camera access
- Windows 10+ or Linux
-
Clone the repository
git clone <repository-url> cd Edgefit-Coach
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python start_app.py
That's it! The application will automatically:
- Start the WebSocket server (port 8001)
- Launch the API server (port 8000)
- Start the Streamlit frontend (port 8501)
- Begin posture monitoring with
main_webcam_headless1.py - Open your browser to
http://localhost:8501
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Streamlit โโโโโบโ FastAPI โโโโโบโ Webcam Stream โ
โ Frontend โ โ Server โ โ (Headless) โ
โ (Port 8501) โ โ (Port 8000) โ โ โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ WebSocket โ โ AI Processing โ
โ Server โ โ - LLM Handler โ
โ (Port 8001) โ โ - Pose Analysisโ
โโโโโโโโโโโโโโโโโโโโ โ - Notificationsโ
โโโโโโโโโโโโโโโโโโโ
Edgefit-Coach/
โโโ ๐ start_app.py # Main application launcher
โโโ ๐ง api_server.py # FastAPI backend server
โโโ ๐น main_webcam_headless1.py # Headless posture monitoring
โโโ ๐ websocket_server.py # WebSocket communication
โโโ ๐จ frontend_test.py # Streamlit web interface
โโโ ๐ค llm_handler.py # AI chat and coaching
โโโ ๐ posture_db.py # Data processing and analytics
โโโ ๐ dashboard_viewer.py # Report generation
โโโ โ๏ธ config.yaml # Configuration settings
โโโ ๐ requirements.txt # Python dependencies
โโโ ๐ API_DOCUMENTATION.md # Detailed API docs
โโโ ๐ QUICK_START.md # Quick setup guide
โโโ ๐ STARTUP_GUIDE.md # Comprehensive startup guide
โโโ ๐ EdgeFit Coach.pdf # Project presentation & overview
GET /health- API health checkGET /files/status- File system status
GET /video/start- Start posture monitoringGET /video/stop- Stop monitoringGET /video/status- Check stream statusWebSocket /ws/motivation- Real-time motivation quotes
GET /dashboard/data- Get comprehensive metricsGET /dashboard/refresh- Force data refresh
POST /chat/message- Send chat messageGET /chat/history- Retrieve conversation historyDELETE /chat/history- Clear chat history
POST /analyze/report- Generate AI analysis reportGET /analyze/report-file- Download raw report
# Single command to start everything
python start_app.py# Test API endpoints
python test_api_endpoints.py
# Run frontend only (requires API server running)
streamlit run frontend_test.py
# Start API server only
python api_server.pyEdit config.yaml to customize:
api_key: "your-api-key"
model_server_base_url: "http://localhost:3001/api/v1"
workspace_slug: "edgefit"
stream: true
stream_timeout: 60- MediaPipe Integration: Advanced pose landmark detection
- ONNX Optimization: Faster inference on edge devices
- Real-time Processing: 13+ FPS video analysis
- Posture Classification: Good posture vs. slouching detection
- Context-Aware Chat: Health and posture-focused conversations
- Motivational Quotes: Dynamic, personalized encouragement
- Performance Analysis: Detailed posture reports with recommendations
- Goal Setting: Adaptive targets based on user progress
- Overhead Reach: Both arms raised above head detection
- Side Stretch: Left/right side stretching recognition
- Real-time Feedback: Immediate exercise validation
- 6 Core Metrics: Comprehensive posture health indicators
- Trend Analysis: Historical performance tracking
- Visual Charts: Interactive data visualization
- Export Capabilities: Report generation and download
# Comprehensive API testing
python test_api_endpoints.py
# WebSocket testing
python test_websocket_client.py
# Notification testing
python test_notifications.py- API Endpoints: Add to
api_server.py - Frontend Components: Modify
frontend_test.py - Posture Logic: Update
main_webcam_headless1.py - AI Features: Extend
llm_handler.py
- Core: FastAPI, OpenCV, MediaPipe, Streamlit
- AI: Custom LLM integration
- Notifications: win10toast (Windows), notify2 (Linux)
- Optimization: ONNX Runtime
- WebSocket: websockets, uvicorn
- Port Conflicts: Ensure ports 8000, 8001, 8501 are available
- Camera Access: Check webcam permissions and availability
- Dependencies: Run
pip install -r requirements.txt - Performance: Enable ONNX Runtime for better performance
- CPU: Multi-core processor recommended
- RAM: 4GB+ for optimal performance
- Camera: USB webcam or built-in camera
- OS: Windows 10+ or Linux with GUI support
- Video Processing: 13+ FPS real-time analysis
- Response Time: <100ms for posture detection
- AI Chat: 30-60 seconds for detailed analysis
- Memory Usage: ~500MB typical operation
- CPU Usage: 15-25% on modern processors
- Remote Work: Maintain good posture during long work sessions
- Health Monitoring: Track posture improvements over time
- Exercise Guidance: Learn proper stretching techniques
- Corporate Wellness: Deploy in office environments
- Healthcare: Physical therapy and rehabilitation support
- Education: Ergonomics training and awareness
- Mobile App: iOS/Android companion applications
- Cloud Integration: Multi-user dashboard and analytics
- Advanced AI: More sophisticated posture analysis
- Wearable Integration: Smartwatch and fitness tracker support
- Team Features: Group challenges and leaderboards
For a comprehensive overview of the project, including architecture, features, and technical details, see:
- EdgeFit Coach.pdf - Complete project presentation with visual diagrams, use cases, and technical specifications
- API_DOCUMENTATION.md - Detailed API endpoint documentation
- QUICK_START.md - Fast setup and testing guide
- STARTUP_GUIDE.md - Comprehensive startup instructions
- POSTURE_LOGGING_GUIDE.md - Posture detection and logging details
- STRETCHING_DETECTION_README.md - Exercise detection algorithms
- LLM_USAGE.md - AI integration and usage guide
This project is licensed under the terms specified in the LICENSE file.
Built for the Qualcomm Edge AI Developer Hackathon. Contributions and feedback are welcome!
๐ Get started in seconds with python start_app.py