Giter Club home page Giter Club logo

drivesafe's Introduction

Drivesafe: Facial Recognition App for Detecting Driver Distraction or Fatigue with YOLOV8

To see the full video go to: DRIVERTY - Facial Recognition for Detecting Driver Distraction or Fatigue.

🎯 Introduction

Drivesafe is an iOS application designed to combat drowsiness and distracted driving using modern machine learning techniques. It emphasizes the integration of PyTorch with Apple's Core ML. Leveraging the power of the YOLOv8 object detection model, DriveSafe is trained on a distinctive dataset that amalgamates records from FORM and YawDD datasets. Its core mission is to detect drowsiness in real-time, fostering safer driving experiences.

πŸ“œ Dataset Details

After fusing and manually annotating data from the mentioned sources, the comprehensive DRIVESAFE Dataset emerges. With Roboflow's assistance, 780 images were annotated. Further preprocessing enhancements, including brightness adjustments and blur effects for data augmentation, expanded the dataset to a grand total of 1886 images.

πŸš€ Model Information

DriveSafe is empowered by the YOLOv8 model, the latest version of the YOLO family of object detection models developed using PyTorch. These models excel at detecting facial features in individual images, presenting bounding box predictions, classifications, and the accompanying confidence scores.

πŸ›  Prerequisites

  • Python: Version 3.7 or higher
  • Development Environment: Xcode

🌟 Quick Start

1️⃣ Prepare the Model:

Start by cloning the repository:

git clone https://github.com/renzodamgo/ios-ObjectDetection-YOLO.git

2️⃣ Launch the App:

Post-cloning, head to the root of the ObjectDetection-CoreML directory and introduce the project with:

open ObjectDetection-CoreML.xcodeproj

3️⃣ Build the App:

Build the app inside xCode on an iOS device (e.g. iPhone 11)

Features and Workflow

DriveSafe boasts a set of features ensuring the driver's safety:

  1. YOLOv8 Object Detection: Identifies:
  • Eyes (Open or Closed)
  • Head's orientation
  • Yawning
  1. Alarm System: Alerts the driver based on real-time insights:
  • Not looking ahead for over 4 seconds
  • Eyes shut for more than 500 ms
  • Yawning exceeding 2 seconds
  1. Audit Log: Retains a log when alarms are triggered, offering insights into potential patterns of distraction or drowsiness.

For installation, ensure the smartphone camera is properly placed on the dashboard behind the steering wheel, capturing the driver's face without any blockages.

DriveSafe's workflow involves:

  1. Streaming video data from the camera to the YOLOv8 model.
  2. Detecting and categorizing facial aspects.
  3. Using Boolean logic to deduce driver's state based on the recognized features.
  4. Activating relevant alarms based on the observations.

πŸ“Š Results

Our preliminary tests have demonstrated promising outcomes:

  • Detection Accuracy: Achieved an impressive 95% accuracy rate for drowsiness detection and 92% for distracted driving detection.
  • Real-time Performance: Maintains a consistent frame rate of 30 FPS on iOS devices (Tested on the iPhone 11).
  • User Feedback: Over 85% of beta testers found DriveSafe to enhance their driving safety and expressed keen interest in continued usage.

πŸ’– Acknowledgements & Contributions

  • Daniel Carnero (@Danilotumix) for his contribution in data annotation, metodology, testing and co-authorship of the research paper.
  • The team at Roboflow for their impeccable annotation toolkit.
  • Thanks to @tucan9389 for his repo ObjectDetection-CoreML that served as guidance to deploy our model into iOS with CoreML.

πŸ“Œ Important Information

  • Explore the training, results, and validation of the YOLOV8 model in this Jupyter notebook.
  • A link to the related research paper will be shared once it's published.
  • Link to the research paper will be provided upon publication.
  • This project and its associated code are governed by the GNU General Public License v3.0. Consequently, any commercial adaptations must remain open source. Legal action will be taken against any infringement.

drivesafe's People

Contributors

renzodamgo avatar

Stargazers

vicky1626 avatar U.Abhishake avatar Renzo MondragΓ³n avatar  avatar

Watchers

Daniel Carnero avatar Kostas Georgiou avatar  avatar

Forkers

danilotumix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.