Inspiration
The National Highway Traffic Safety Administration estimates that drowsy driving was responsible for 72,000 crashes, 44,000 injuries, and 800 deaths. Driver fatigue is one of the major cause of road accidents, accounting up to 20% of serious accidents.
What it does
Using Computer Vision through OpenCV, we detect the drowsiness by evaluating the eye aspect ratio (EAR) and sounds a blaring alarm when this ratio falls below a certain threshold. The aim of the alarm is to wake the driver up and alarm the passenger(s) present.
How we built it
Frontend: Flask, HTML5/CSS3/BootStrap Backend: Python, OpenCV, Numpy, Dlib, Imutils, Playsound, Argparse. We calculated the vertical and horizontal distances of the eye and took their respective ratio. On average, it fluctuated from 0.25-0.3 for people on an average bases.
Challenges I ran into
Initially, mapping the shape predictor model (pre-trained) to the face of the person seemed really challenging. We had to define a relative real work 3D space. Moving on, drawing contours on the face of the person took a toll on the team due to overlays and overlapping leading to FPS drop. Thirdly, converting 2D model coordinates to real world 3D coordinates took a lot of time as it wasn't a pre-define function in any library. We ended up creating a relative 3D system for the frames. Finally, deciding on the EAR based on real life samples was difficult, people with varying eye size posed a serious problem.
Accomplishments that I'm proud of
Mainly, visualizing 2D to real world 3D coordinates felt great, it took a toll on our team and made us think out of the box. From the technical side, integrating openCV with dlib, used for facial shape prediction, was a real bummer as it took different methods on different operating systems. As per the accuracy factor, obtaining fairly accurate results for any person felt great.
What's next for BN-WakeUp!
Implementing new features such as head pose elimination, solvePnP etc. We would love to create a prototype with a webcam and a raspberry pi, being portable and affordable at the same time.
Log in or sign up for Devpost to join the conversation.