- Bhumika Kothwal - [email protected]
- Donovan Crasta - [email protected]
- Nishtha Sainger - [email protected]
- Pratam Jain - [email protected]
- Priyesh Vakharia
- Parth Shah
- Saif Kazi
- Description
- Technology Stack
- Project Setup
- Usage
- File Structure
- Applications
- Future Scope
- Screenshots
This Project is a combination of computer vision , front-end and back-end development . In this with the help of a web camera a continous image (known as video) is taken as input and with the help of some eucledian mathematics , algorithims , inbuilt packages and models of python , if the user is found to be sleepy/drowsy an alarm beeps making the user aware of conditions so that proper care can be taken of his/her sleepy situation.
It has an accuracy of approximately 95% and a reaction time of less than 1 second making it efficient.
It can also be used by students to keep themselves awake while studing as the alarm will wake them up whenever they feel drowsy allowing them to continue their studies without any tension of drowsing off.
- To get face landmarks-
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor('shape_predictor_68_face_landmarks.dat')
def detect_shape(self, gray, rect, predictor):
shape = predictor(gray, rect)
shape = face_utils.shape_to_np(shape)
return shape
shape = obj.detect_shape(gray, rect, predictor)
- To calculate euclidean distance-
def calculate_ratio(eye):
A = d.euclidean(eye[1], eye[5])
B = d.euclidean(eye[2], eye[4])
C = d.euclidean(eye[0], eye[3])
ratio = (A + B) / (2.0 * C)
return ratio
- GitHub repo link: Binary-Beasts
- Drive link: Drive link here
- PPT link: PPT link here
Tools and technologies that you learnt and used in the project.
- Python
- Machine Learning
- OpenCV
- Javascript
- HTML
- CSS (basic)
See SETUP.md for the installation steps.
Clone the repo
$ git clone https://github.com/Bhumika-Kothwal/Binary-Beasts.git
Run the webapp.py file using the command -
$ python webapp.py
Go to the link which shows on terminal.
Click here to understand how to go about with the web-app.
.
├── screenshots # contains screenshot of the project
├── fonts
├── img
├── mail
├── alarm.wav # alarm file
├── shape_predictor_68_face_landmarks # dlib classifier to detect facial landmarks
├── static
│ ├── js # contains .js files
│ ├── styles # contains .css files
│ └── demo.mp4 # contains demo of our project
├── templates # conatins HTML pages
│ ├── demo.html # contains demo video
│ ├── start.html # live drowsiness detection page
│ └── index.html # home page
├── drowsiness_detection # conatins python code
│ ├── eye_yawn_detection # python code for drowsiness detection
│ └── __init_.py
├── webapp.py # conatins server-side Flask code
├── SETUP.md # contains installation instructions of different modules
└── README.md
It can be used to detect if a driver is drowsy or not during driving and plays alarm if the driver is drowsy resulting in prevention of accidents.
It can also be used by students to keep themselves awake while studying as the alarm will wake them up whenever they feel drowsy allowing them to continue their studies without any tension of drowsing off.
The project now uses the web-cam to capture the images of driver to process upon. Further work includes -
- Providing feature to capture images using Raspberry-Pi or other external camera
- Building this model into a hardware which can be directly fixed onto a place
- Making this into a web-application and can be used by any external server as well