https://github.com/dipan313/sarathi
π SARATHI β A real-time AI-based attention monitoring system for drivers and pilots that detects drowsiness, posture issues, and inattention. Built with Python, MediaPipe, OpenCV, and Streamlit.
https://github.com/dipan313/sarathi
blinker matplotlib mediapipe opencv pygame python raspberry-pi streamlit t
Last synced: 2 months ago
JSON representation
π SARATHI β A real-time AI-based attention monitoring system for drivers and pilots that detects drowsiness, posture issues, and inattention. Built with Python, MediaPipe, OpenCV, and Streamlit.
- Host: GitHub
- URL: https://github.com/dipan313/sarathi
- Owner: dipan313
- Created: 2025-06-21T07:56:20.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-21T18:35:35.000Z (12 months ago)
- Last Synced: 2025-06-21T19:25:05.426Z (12 months ago)
- Topics: blinker, matplotlib, mediapipe, opencv, pygame, python, raspberry-pi, streamlit, t
- Language: Python
- Homepage:
- Size: 79.1 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π SARATHI β Unified Attention Monitoring for Transportation
> "A momentβs lapse. A lifetime lost. SARATHI watches, warns, and saves."
---
## π Overview
**SARATHI** is a real-time AI-based driver and pilot attention monitoring system that **detects drowsiness**, **unsafe posture**, and **inattentiveness**. It serves as a **digital co-pilot**, ensuring that no fatigue-related accident goes unnoticed.
Developed during **Hack4Bengal 4.0** β Eastern India's Largest Hackathon, SARATHI addresses one of the deadliest causes of transport-related deaths β **fatigue**.
---
## YouTube Video Link : https://youtu.be/lDf7jZFTieQ
---
| Front View | Side View |
|--------|---------|
|  |  |
## π Key Features (USPs)
- β
**Dual-layer Detection**: Simultaneously monitors **eye behavior**, **head pose**, and **body posture**
- πΌ **Screenshot Capture**: Takes periodic screenshots during alert states
- π£ **Smart Alerts**: Audio alarm + visual warnings when fatigue is detected
- π‘ **Lightweight**: No heavy ML models β optimized for laptops & Raspberry Pi
- π **Low Resource Usage**: CPU-efficient, real-time performance
- π§ **Fully Modular**: Easily extendable for dual camera or IoT deployment
---
## π Impact & Benefits
| π Road Safety | π Fleet Monitoring | β Pilot Awareness |
|----------------|---------------------|--------------------|
| Reduces fatigue-related accidents | Real-time monitoring for public transport | Can scale to cockpit fatigue detection |
---
## π§ Tech Stack
| Category | Tools/Technologies |
|---------|-------------------|
| Language | Python |
| Libraries | OpenCV, MediaPipe, NumPy, Pygame |
| UI | Streamlit |
| Audio | Pygame |
| Utilities | jsonschema, tornado |
| Future Hardware | Raspberry Pi 4, external buzzer/cam |
---
## β Installation & Run Guide
### π 1. Clone the Repository
bash
git clone https://github.com/your-username/sarathi.git
bash
cd sarathi
### π 2. Install Requirements
bash
pip install -r requirements.txt
### βΆ 3. Launch the App
bash
streamlit run driver_state_detection/app.py
> β Make sure your webcam is connected and accessible.
---
## π§ͺ Technical Workflow
SARATHI performs **attention analysis** using:
- π **Eye landmarks** to detect prolonged closure or gaze shifts
- π§ **Head pose** (pitch, yaw, roll) to monitor orientation
- π§ **Posture deviation** using shoulder & spine angles
π§ **If any threshold is crossed**:
- Screenshot is captured
- Audio alarm is triggered
- Visual status bar updates on Streamlit UI
---
## π§ββ Challenges Faced
- β Real-time processing without GPU
- π Handling low-light conditions
- β Ensuring accuracy while minimizing false alarms
- π Angle-sensitive posture detection
- π§ Calibrating thresholds across multiple face orientations
---
## π± Future Enhancements
- π· **Dual camera setup** (side + front view) using IoT (e.g., Raspberry Pi)
- π§ **User posture calibration** on startup for custom thresholds
- β **Gesture-based alert dismissal** using hand detection
- π¨ **SOS Trigger**: Auto-message if alert persists beyond limit
- π **Night mode** via IR camera support
---
## π Developed At
**Hack4Bengal 4.0 β June 2025**
Team Name: **Dot Slash**
Team Lead: **Dipan Mazumder**
Team Member: **Subhas Pramanik**
---
## π Why the Name "SARATHI"?
In ancient Indian tradition, *SARATHI* means βcharioteerβ β the one who safely drives the warrior through chaos.
In our context, SARATHI acts as a *modern digital guide, **monitoring attentiveness, **preventing fatigue-induced danger, and **saving lives* through intelligence.
---
## π¬ Contact
| π§ Email | π» GitHub | π LinkedIn |
|----------|-----------|--------------|
| [Dipan Mazumder](mailto:dipanmazumder313@gmail.com)
[Subhas Pramanik ](mailto:subhaspramanik38@gmail.com) | [Dipan Mazumder](https://github.com/dipan313)
[Subhas Pramanik](https://github.com/subhas-pramanik-09) | [Dipan Mazumder](https://www.linkedin.com/in/dipan-mazumder-953453279/)
[Subhas Pramanik](https://www.linkedin.com/in/subhas-pramanik) |
---
> Built to protect. Designed to alert. SARATHI is not just code β it's a life-saving companion.