A comprehensive health monitoring application that combines real-time posture detection, health scoring, and intelligent AI advice - all running locally on your machine.
- Real-time Posture Monitoring: Webcam-based posture analysis using MediaPipe
- Local AI Assistant: Intelligent health advice using Ollama (completely offline)
- Health Score Calculation: ML-powered daily health scoring
- Smart Reminders: Context-aware advice when posture degrades
- Privacy-First: All data processed locally, nothing sent to external servers
- Automatic Calibration: Personal posture reference calibration
- Historical Tracking: Monitor trends and improvements over time
- Python 3.8+ with pip
- Webcam for posture detection
- Ollama for AI features (optional but recommended)
# 1. Clone the repository
git clone <repository-url>
cd Equilibri
# 2. Install Python dependencies
pip install -r requirements.txt
# 3. Install Ollama (for AI features)
# Visit https://ollama.ai and install Ollama
# Then install a model:
ollama pull llama3:8b# Navigate to the Python source directory
cd src/python
# Run the main monitoring application
python equilibri_terminal.pyEquilibri/
โโโ src/python/
โ โโโ equilibri_terminal.py # Main application with AI integration
โ โโโ simple_monitoring.py # Simplified version without AI
โ โโโ posture_score.py # Posture scoring algorithm
โ โโโ ollama_advisor.py # AI health advisor
โ โโโ ml_health_scorer.py # ML health scoring engine
โ โโโ data_generator.py # Synthetic health data generator
โ โโโ train_health_model.py # ML model training
โ โโโ test_ollama.py # Test Ollama integration
โ โโโ config.py # Configuration constants
โโโ data/ # Health data storage
โ โโโ daily.json # Daily checkpoints
โ โโโ config.json # User calibration data
โโโ requirements.txt # Python dependencies
โโโ equilibri.sh # Launch script
โโโ README.md # This file
-
Start the application:
python src/python/equilibri_terminal.py
-
Posture Calibration (mandatory):
- Position yourself in your ideal work posture
- Press 'c' to start calibration
- Hold the position for 30 measurements
- Calibration data is saved for future sessions
-
Initial Health Data:
- Enter your sleep hours, hydration, and step count
- These can be updated during the session
The application will:
- Monitor posture every 30 seconds automatically
- Provide AI advice when posture degrades or at startup
- Save checkpoints with health scores and posture data
- Give encouraging feedback based on your performance
While the application is running, you can use these commands:
hydration 2.5 # Update hydration to 2.5L
steps 8000 # Update step count to 8000
status # Show current health data
quit # Exit with AI summary- Startup Analysis: Reviews your 7-day history and provides quick advice
- Smart Interventions: Gives advice when posture score drops below 60/100
- Session Summary: Provides encouraging feedback and tips when you quit
- Cooldown System: Prevents advice spam (5-minute minimum between suggestions)
# Install Ollama from https://ollama.ai
# Pull the recommended model
ollama pull llama3:8b
# Verify installation
ollama list# Test if Ollama is working correctly
python src/python/test_ollama.pyThe application uses a sophisticated ML model that analyzes:
| Metric | Description | Optimal Range | Impact |
|---|---|---|---|
| Sleep Hours | Nightly sleep duration | 7-9 hours | High |
| Daily Steps | Physical activity | 8,000+ steps | High |
| Hydration | Water intake | 2-3 liters | Medium |
| Posture Score | Real-time posture quality | 70+ /100 | High |
| Stress Level | Self-reported stress | Low | Medium |
| Mood | Daily mood state | Good/Neutral | Medium |
| Screen Time | Digital device usage | <6 hours | Low |
The posture detection uses MediaPipe to analyze:
- Shoulder alignment (left/right balance)
- Head position relative to shoulders
- Forward head posture
- Distance from camera (too close/far)
- Lateral head tilt
Scores range from 0-100, with penalties for poor posture and bonuses for ideal positioning.
# Generate synthetic training data and train models
python src/python/train_health_model.py --days 2000
# Test the trained model
python src/python/test_health_scorer.pyIf you prefer to run without Ollama:
# Use the simplified version
python src/python/simple_monitoring.pyYour health data is stored in:
data/daily.json: Health checkpoints and posture scoresdata/config.json: Calibration settings
All data stays on your machine and is never transmitted externally.
Key Python packages:
opencv-python: Computer vision and webcam accessmediapipe: Pose detection and analysisscikit-learn: Machine learning modelsollama: Local AI integrationnumpy,pandas: Data processing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
python test_ollama.py - Submit a pull request
Camera not found:
# Check camera permissions and availability
# Ensure no other app is using the webcamOllama not responding:
# Check if Ollama is running
ollama list
# Start Ollama service if needed
ollama servePermission errors:
# Ensure camera permissions are granted
# Run with appropriate permissionsPoor posture detection:
- Ensure good lighting
- Position camera at eye level
- Sit 60-80cm from camera
- Recalibrate if needed
- Close other camera applications
- Ensure stable lighting conditions
- Use the simplified version if performance is poor
- Adjust monitoring frequency in code if needed
The application provides:
- Real-time posture scoring with visual feedback
- Trend analysis over days and weeks
- Personalized AI recommendations based on your patterns
- Encouraging feedback to maintain motivation
- Actionable advice for immediate improvements
For demonstration purposes:
# Quick test of all features
python src/python/test_health_scorer.py
# Test just the AI integration
python src/python/test_ollama.py
# Manual posture scoring
python src/python/posture_score.py[Add your license information here]
For questions or issues:
- Check the troubleshooting section
- Review the code documentation
- Test individual components
- Create an issue with detailed information
Equilibri - Your personal health companion, powered by local AI and computer vision.