PoseGuard is a real-time AI-powered driver monitoring system that detects distracted or unsafe driver postures using computer vision and deep learning. It generates instant audio-visual alerts, captures incident screenshots, and logs them for admin review through a secure, role-based web portal.
- 🎯 Real-time driver pose detection using a trained CNN model.
- 🔊 Automated visual and audio alerts on detecting unsafe behavior.
- 🖼️ Incident screenshots saved with timestamps for review.
- 🧑💼 Role-based access with separate user and admin portals.
- 📊 Admin dashboard to view reports and monitoring insights.
- 🌐 Responsive frontend built with Tailwind CSS and Flask.
- 🔒 Secure authentication using hashed passwords.
| Layer | Technologies |
|---|---|
| Frontend | HTML, Tailwind CSS, Jinja2 |
| Backend | Flask, Python |
| AI/Model | TensorFlow / Keras (CNN-based) |
| Database | SQLite (via SQLAlchemy) |
| Utilities | OpenCV, playsound, bcrypt |
According to the WHO, distracted and drowsy driving causes nearly 25% of all road accidents, resulting in over 1.3 million deaths per year. PoseGuard aims to tackle this by offering a low-cost, real-time alerting system for transport and fleet operators to improve safety and accountability.
- The user logs into the system using secure credentials.
- Upon login, the camera feed starts and the AI model begins analyzing poses.
- If an unwanted pose (e.g., drowsiness, mobile use) is detected:
⚠️ A warning sound is played.- 🖼️ A screenshot is saved with a timestamp.
- 🗂️ The event is logged in the database.
- Admins can log in to view all incidents in the admin portal and reports section.
| Path | Description |
|---|---|
PoseGuard/ |
Root project directory |
├── app.py |
Main Flask application |
├── pose_detection.py |
CNN model loading and inference logic |
├── model/ |
Contains the trained Keras model (.h5) |
├── static/ |
Static assets folder (CSS, JS, sounds, images) |
│ ├── css/ |
Custom styling files |
│ ├── js/ |
Custom JavaScript scripts |
│ ├── resources/ |
Alert sound files |
│ └── screenshots/ |
Captured incident screenshots |
├── templates/ |
HTML templates (Jinja2) |
│ ├── base.html |
Base layout template |
│ ├── dashboard.html |
User dashboard interface |
│ ├── admin_portal.html |
Admin-only portal for screenshots |
│ ├── login.html / signup.html |
User authentication pages |
│ └── reports.html / alerts.html |
Incident reports and alert pages |
├── test.db |
SQLite database storing users and alerts |
- Unit tests written using
unittestfor user login, pose detection, and alert logging. - Manual testing performed for real-time monitoring and admin portal functionality.
- Successfully logged and visualized 500+ pose incidents during test runs.
![]() |
![]() |
![]() |
![]() |
| Role | Access |
|---|---|
| User | Live monitoring, alerts |
| Admin | Full access to reports, incident screenshots, and analytics |
Only users with emails ending in @poseguard.com are granted admin privileges.
- Python 3.7+
- TensorFlow
- Flask
- OpenCV
- playsound
- SQLAlchemy
- bcrypt
Install using:
pip install -r requirements.txt⚙️ Run the Project
python app.pyThen visit: http://127.0.0.1:5000/ in your browser.
Repository protected through License and only for reasearch and educational purpose.



