Explore the docs »
Architecture
·
Features
·
Local Setup
Problem Statement
Despite automotive technology advancements, global concern persists regarding driver safety due to increasing vehicle numbers, heightening accident risks. Our project aims to tackle this by:
- Calculating safe driving areas through analysis of roadway conditions.
- Developing precise lane boundary detection to prevent lane departures.
- Integrating safety features like Drowsiness, Seat Belt, and Smoking, Drinking and Occupancy Detection to monitor and mitigate driver risks.
- Providing solution at a sustainable cost for all the drivers.
Through these initiatives, we aim to substantially reduce road accidents and enhance overall road safety.
Features
- Prioritizing measures and practices aimed for reducing risks and ensuring the well-being of drivers on the road. Enhancing safety through real-time insights and alerts for specific vehicle types.
- The project scope explicitly excludes integration of autonomous technology, emphasizing a focus solely on conventional driver-operated systems.
- The algorithmic solutions for this project are specifically tailored to address safe area calculation, lane detection, and driver behavior monitoring. Safe area calculation algorithms are designed to identify and analyze potential hazards within the driving environment.
- Aiming to promote responsible habits without involving hardware components in all vehicle types.
The architecture:
- Initialize and Load Models:
- Import required libraries and load pre-trained models for object detection, smoking, and drinking detection.
- Load face and eye cascades for drowsiness detection.
- Video Capture and Frame Processing:
- Capture video frames from the input video.
- Resize frames and limit the region of interest.
- Face and Seatbelt Detection:
- Detect faces and draw rectangles around them.
- Use a pre-trained model to detect seatbelt usage and log the results.
- Smoking and Drinking Detection:
- Apply smoking and drinking detection models on the frames.
- Draw bounding boxes and labels for detected objects.
- Drowsiness Detection:
- Detect eyes within the face regions.
- Log and label the frames if no eyes are detected (indicating drowsiness).
- Display Results:
- Draw a dashboard on the frames to display the status of smoking, drinking, seatbelt usage, drowsiness, and face count.
- Show the video feed with the drawn information.
- Log and Post-Processing:
- Log activities such as face count, smoking, drinking, seatbelt usage, and drowsiness.
- Read the log file and generate a report summarizing the detections and their counts.
- Clean Up:
- Release video capture and close all OpenCV windows after processing.
- Computer Vision
- YOLO
To set up the project locally, follow these steps:
- Clone the repository
git clone https://github.com/your_username/SmartDrive.git
cd SmartDrive
- Install the required packages
pip install -r requirements.txt
- Install specific versions of the required libraries
pip install cv2==4.8.0
pip install numpy
pip install torch
pip install opencv-python
pip install opencv-contrib-python
pip install ultralytics
pip install cvzone
- Run the application
python App.py
Local Setup || Project Structure
NOTE: Individual instructions can be found in respective directories.
*
├───Module 1 - BackCam
├───Module 2.1 - FrontCam
├───Module 2.2 - FrontCam
├───Module 2.3 - FrontCam
├───Module 2.4 - FrontCam
├───Module 2.5 - FrontCam
├───Safe-lane-detection
└───App.py
Module 1 - BackCam
: Safe lane detection.Module 2.1 - FrontCam
: Drinking detection.Module 2.2 - FrontCam
: Drowsiness detection.Module 2.3 - FrontCam
: Smoking detection.Module 2.4 - FrontCam
: Seatbelt detection.Module 2.5 - FrontCam
: Occupancy detection.