Skip to content

AdityaSrivastavDS/PoseGuard

Repository files navigation

🚗 PoseGuard – Driver Unwanted Pose Detection and Feedback System

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.


📌 Features

  • 🎯 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.

🛠️ Tech Stack

Layer Technologies
Frontend HTML, Tailwind CSS, Jinja2
Backend Flask, Python
AI/Model TensorFlow / Keras (CNN-based)
Database SQLite (via SQLAlchemy)
Utilities OpenCV, playsound, bcrypt

🧠 Problem Statement

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.


🚀 How It Works

  1. The user logs into the system using secure credentials.
  2. Upon login, the camera feed starts and the AI model begins analyzing poses.
  3. 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.
  4. Admins can log in to view all incidents in the admin portal and reports section.

📂 Project Structure

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

🧪 Testing the System

  • Unit tests written using unittest for 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.

🖥️ Screenshots

🏠 Landing Page

Homepage

🖼️ Live Detection

Live Detection

🛡️ Admin Portal

Admin Portal

📊 Alerts Report

Reports

🔒 Access Control

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.


📦 Requirements

  • Python 3.7+
  • TensorFlow
  • Flask
  • OpenCV
  • playsound
  • SQLAlchemy
  • bcrypt

Install using:

pip install -r requirements.txt

⚙️ Run the Project

python app.py

Then visit: http://127.0.0.1:5000/ in your browser.

📃 License

Repository protected through License and only for reasearch and educational purpose.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published