Drowsiness Detection using OpenCV library in Python

Harsh Tiwari (~harsh86)




Usage and misuse of alcohol, tobacco, and illicit medications and abuse of prescription drugs cost people billions of dollars a year, increasing the prices, violence, and lost efficiency in healthcare. Every year, more than 300,000 worldwide people die from illegal drugs and alcohol, while tobacco and other smoke-consuming medications are correlated with an annual estimated 1.480,000 deaths. The problem scenario which is being analyzed causes a lot of chaos and loss of not only monetary components of the economy but also the leaves shattering damage to the manpower and the infrastructure and misguides the youth. Primary methods which are being congregated to stop or minimize the situation from deteriorating further are the use of IoT sensors like MQ-3 for alcohol and smoke detection, pulse and blood pressure sensor and further making it more precise by the use of some machine learning modules for face detection namely OpenCV which uses Python. It will help in law enforcement and safety of the people while driving and many other activities by breaking the circuit which will finally result in the shutting down of motor which will lead to automobiles or any other instrument to come to a stationary state.

Also, it could be majorly used inthe field of sports to test the athletes and to assure that they do not consume any unauthorized or illegal stamina enhancers that break the normal physiological constraints of the human body. The future prospects and scopes of this tool are unlimited and this can be integrated within many bigger systems which have an intermediate state that requires checking the narcotic materials or any physiological anomalies in the user and can be of great use of different user groups of different communities. Therefore, it would help in decreasing the unnatural death rate which is caused by the excessive consumption of alcohol or drugs and law enforcers to catch the defaulters easily so that they would not indulge in criminal activities and can be sent for rehabilitation.

Here is the outline of the talk (Total time - 30 mins)

  • Quick intro of OpenCV library (5 mins)
  • List of libraries used for face detection (2 mins)
  • How to plot landmarks on the face (5 mins)
  • Eye Aspect Ratio (5 mins)
  • Frame Reference (5 mins)
  • Sound and alarm libraries (2 mins)
  • Future Scope (1 min)
  • QnA (5 mins)


  • Basic Python Programming

Content URLs:



Speaker Info:

I am Harsh and I am currently working in Cerner Healthcare Solutions India and develop solutions for the IT healthcare Revenue Cycle. My main aim and passion are to pursue masters in the field of Machine Learning and Artificial Intelligence. It is my fond hope to conduct advanced research and get academic recognition by publishing papers and journals. As part of my short term goals, after my education, I am looking forward to working as a researcher or an engineer at reputed companies in a role that involves ML. Looking at the long term, I aim to be a researcher of repute in the field of Machine Learning in academia or in the tech industry which is at the forefront of AI research.

Speaker Links:

  • Github - https://github.com/mastermindharsh
  • LinkedIn - https://www.linkedin.com/in/harsh-tiwari-82180a144/
  • Twitter - https://twitter.com/HarshMastermind
  • My Website - http://mastermindharsh.github.io/website

Section: Data Science, Machine Learning and AI
Type: Talks
Target Audience: Intermediate
Last Updated: