An open API service indexing awesome lists of open source software.

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.

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 |
|--------|---------|
| ![Front View](https://github.com/user-attachments/assets/8fb8087d-81d5-4952-8b27-e60a220ff531) | ![Side View](https://github.com/user-attachments/assets/3d908436-dbb5-400b-803e-ace2f6a058f7) |

## πŸš€ 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.