Skip to content

DriveEye is an AI-powered driver monitoring and surveillance system built for real-time safety on the road.

Notifications You must be signed in to change notification settings

hasithdd/DriveEye

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚗 DriveEye

AI-Powered Driver Monitoring System

License: MIT

Real-time drowsiness detection using YOLOv5 + TensorRT, built for public transport safety.


✨ Features

  • 🧠 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

1. 🐳 Pull Docker Image

sudo docker pull {pytorch image with tensorrt and cuda}

📦 Project Setup

Clone Repository

git clone https://github.com/your-username/DriveEye.git
cd DriveEye

Dataset (Roboflow)

Use Driver Drowsiness v3 in YOLOv5 format:

Dataset1/
├── data.yaml
├── train/
│   ├── images/
│   └── labels/
└── valid/
    ├── images/
    └── labels/

🏋️ Model Training

python3 Training/train.py
  • Output: Training/runs/detect/weights/best.pt

🧪 Testing the Model

python3 Training/test.py

🧠 Export to TensorRT

python3 Models/tensorrt_export.py
  • Outputs: Models/best.engine

🎥 Run Inference

Update camera index if needed in Inference/video_infer.py:

cap = cv2.VideoCapture(0)  # Replace 0 if needed

Then run:

python3 main.py --mode inference

📂 Directory Structure

DriveEye/
├── Dataset1/
├── Inference/
├── Models/
├── Training/
├── Logger/
├── DataCollector/
├── logs/
│   ├── incidents/
│   └── high_confidence/
├── Dockerfile
├── main.py
├── requirements.txt
└── README.md

🐳 Docker

sudo docker build -t driveeye .
sudo docker run -it --runtime nvidia --network host \
  -v $PWD:/app --workdir /app driveeye \
  python3 main.py --mode inference

🧩 Troubleshooting

  • 📷 Camera not detected? Try another index:
v4l2-ctl --list-devices

📌 Roadmap

  • ✅ GPS integration
  • 📈 MLflow experiment tracking
  • ♻️ Retraining pipeline w/ real-world data
  • 🚦 Multi-behavior detection (texting, yawning, etc.)

🤝 Contributing

PRs and issue reports are welcome!


About

DriveEye is an AI-powered driver monitoring and surveillance system built for real-time safety on the road.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published