Loading repository data…
Loading repository data…
7vik2005 / repository
DeskGuardian is a real-time AI-powered desktop application for posture monitoring, screen-time tracking, burnout prediction, and wellness analytics. Built with PyQt5, MediaPipe, OpenCV, scikit-learn, and SQLite, it provides live posture detection, break tracking, smart alerts, and an interactive analytics dashboard.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
A real-time AI-powered desktop application that monitors user posture, detects prolonged screen time, and predicts burnout risk using computer vision and machine learning — all wrapped in a modern PyQt5 graphical interface.
DeskGuardian is a comprehensive workplace wellness application designed to:
All metrics are logged to an SQLite database for historical analysis and dashboard visualization.
data/burnout_model.pkldata/deskguardian.log)┌─────────────────────────────────────────────────────────────┐
│ DeskGuardianApp (main.py) │
│ Application controller: Login → Monitoring │
└──────────────────┬──────────────────────────────┬────────────┘
│ │
┌────────▼────────┐ ┌─────────▼──────────┐
│ LoginSignupPage│ │ MonitoringWindow │
│ (modules/gui/) │ │ (modules/gui/) │
└────────┬────────┘ └───┬─────────┬──────┘
│ │ │
┌────────▼────────┐ │ ┌────▼───────┐
│ AuthService │ │ │DashboardUI │
│ (modules/auth/)│ │ │(modules/ │
└─────────────────┘ │ │ dashboard/)│
│ └────────────┘
┌────────────────────────────────┘
│
┌──────▼──────────────────────────────────────────────┐
│ Core Components (per session) │
├──────────┬──────────┬───────────┬───────────────────┤
│PoseDetect│SessionMgr│BurnoutMdl │NotificationEngine │
│(MediaPipe│(Behavior │(ML Model) │(Popups + DB Log) │
│ + OpenCV)│ Tracking)│ │ │
└────┬─────┴────┬─────┴─────┬─────┴─────┬─────────────┘
│ │ │ │
└──────────┴───────────┴───────────┘
│
┌────▼────┐
│DBManager│
│(SQLite) │
└┬────────┘
│
┌─────────▼──────────┐
│ Database File │
│(data/deskguardian) │
└────────────────────┘
| Component | Technology |
|---|---|
| Language | Python 3.10+ |
| GUI Framework | PyQt5 (login, monitoring, dashboard, notifications) |
| Computer Vision | MediaPipe Pose, OpenCV |
| ML Framework | scikit-learn (burnout model) |
| Database | SQLite3 |
| Data Processing | NumPy, Pandas |
| Visualization | Matplotlib |
| Serialization | joblib (model persistence) |
| Notifications | plyer (cross-platform desktop notifications) |
| Packaging | PyInstaller (standalone Windows executable) |
| Authentication | hashlib PBKDF2-HMAC SHA-256 |
DeskGuardian/
├── main.py # Application entry point (QApplication + tray icon)
├── requirements.txt # Python dependencies
├── DeskGuardian.spec # PyInstaller spec for building .exe
├── README.md # This file
│
├── config/
│ ├── constants.py # Thresholds, limits, timings, alert types
│ └── settings.py # Feature toggles (logging, alerts)
│
├── core/
│ ├── system_controller.py # Central orchestrator (headless/CLI mode)
│ ├── state_manager.py # System state machine
│ └── background_timer.py # Screen time and burnout check timers
│
├── database/
│ ├── db_manager.py # SQLite CRUD operations
│ ├── models.py # Data models / schemas
│ └── schema.sql # Database schema definition (6 tables)
│
├── modules/
│ ├── auth/
│ │ └── auth_service.py # User registration & login (password hashing)
│ │
│ ├── gui/
│ │ ├── login_page.py # Login / Signup PyQt5 window
│ │ ├── monitoring_window.py # Live camera feed + metrics + dashboard access
│ │ └── notification_popup.py # Slide-in desktop notification popups
│ │
│ ├── behavior_tracking/
│ │ ├── session_manager.py # Session lifecycle & integration layer
│ │ ├── screen_time_tracker.py # Screen time metrics
│ │ └── break_detector.py # Break event detection
│ │
│ ├── burnout_prediction/
│ │ ├── burnout_model.py # ML model inference
│ │ └── feature_engineering.py # Feature extraction for ML
│ │
│ ├── posture_detection/
│ │ ├── pose_detector.py # Webcam & pose landmark extraction
│ │ ├── posture_classifier.py # Angle-based posture classification
│ │ └── posture_metrics.py # Angle computation (back, neck, shoulder)
│ │
│ ├── notification/
│ │ └── notification_engine.py # Alert generation, popup dispatch, DB logging
│ │
│ └── dashboard/
│ ├── dashboard_ui.py # PyQt5 analytics dashboard
│ └── analytics_engine.py # Data aggregation for dashboard
│
├── tests/
│ ├── conftest.py # Pytest configuration
│ ├── test_analytics_engine.py # Dashboard analytics tests
│ ├── test_auth_service.py # Authentication tests
│ ├── test_break_detector.py # Break detection tests
│ ├── test_helpers.py # Utility function tests
│ ├── test_login_page_gui.py # Login page GUI tests
│ ├── test_notification_engine.py # Notification engine tests
│ └── test_posture_classifier.py # Posture classification tests
│
├── utils/
│ ├── enums.py # PostureClass, AlertType, SystemState
│ ├── helpers.py # Utility functions
│ └── logger.py # Centralized logging
│
├── data/ # Runtime data directory
│ ├── deskguardian.db # SQLite database
│ ├── deskguardian.log # Application log file
│ ├── burnout_model.pkl # Pre-trained burnout classifier
│ └── burnout_scaler.pkl # Feature scaler for burnout model
│
├── dist/ # PyInstaller output (built executable)
├── build/ # PyInstaller build artifacts
└── venv/ # Python virtual environment
git clone https://github.com/7vik2005/DeskGuardian.git
cd DeskGuardian
# On Windows
python -m venv venv
venv\Scripts\activate
# On macOS/Linux
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python main.py
You should see:
DeskGuardian can be packaged as a standalone Windows executable using PyInstaller:
# Install PyInstaller (if not already installed)
pip install pyinstaller
# Build using the included spec file
pyinstaller DeskGuardian.spec
The built application will be available in dist/DeskGuardian/. Run DeskGuardian.exe to launch without needing a Python installation.
All configuration is centralized in the config/ directory:
Contains system-wide thresholds:
# Posture angle thresholds (degrees deviation from vertical, based on ISO 11226)
GOOD_POSTURE_MAX_BACK_ANGLE = 15
GOOD_POSTURE_MAX_NECK_ANGLE = 15
SLIGHT_BAD_POSTURE_MAX_BACK_ANGLE = 25
SLIGHT_BAD_POSTURE_MAX_NECK_ANGLE = 25
BAD_POSTURE_MAX_BACK_ANGLE = 40
BAD_POSTURE_MAX_NECK_ANGLE = 40
# Screen