Real-time drowsiness detection using YOLOv5 + TensorRT, built for public transport safety.
- 🧠 Binary YOLOv5 model (
drowsy/not_drowsy) - 🔁 3-second buffer detection logic
- ⚡ TensorRT optimized for Nvidia GPUs
- 📷 Live USB/CSI camera feed
- 📝 Incident logging with timestamped frame & metadata
- 🧪 High-confidence data collection for retraining
sudo docker pull {pytorch image with tensorrt and cuda}git clone https://github.com/your-username/DriveEye.git
cd DriveEyeUse Driver Drowsiness v3 in YOLOv5 format:
Dataset1/
├── data.yaml
├── train/
│ ├── images/
│ └── labels/
└── valid/
├── images/
└── labels/
python3 Training/train.py- Output:
Training/runs/detect/weights/best.pt
python3 Training/test.pypython3 Models/tensorrt_export.py- Outputs:
Models/best.engine
Update camera index if needed in Inference/video_infer.py:
cap = cv2.VideoCapture(0) # Replace 0 if neededThen run:
python3 main.py --mode inferenceDriveEye/
├── Dataset1/
├── Inference/
├── Models/
├── Training/
├── Logger/
├── DataCollector/
├── logs/
│ ├── incidents/
│ └── high_confidence/
├── Dockerfile
├── main.py
├── requirements.txt
└── README.md
sudo docker build -t driveeye .
sudo docker run -it --runtime nvidia --network host \
-v $PWD:/app --workdir /app driveeye \
python3 main.py --mode inference- 📷 Camera not detected? Try another index:
v4l2-ctl --list-devices- ✅ GPS integration
- 📈 MLflow experiment tracking
- ♻️ Retraining pipeline w/ real-world data
- 🚦 Multi-behavior detection (texting, yawning, etc.)
PRs and issue reports are welcome!