Тёмный

Driver Drowsiness Detection System using OpenCV | Graduation final year Project with Source Code 

Project Guru
Подписаться 1,1 тыс.
Просмотров 53 тыс.
50% 1

Driver Drowsiness Detection System using OpenCV | Drowsiness Detection System in Real-Time using OpenCV | Driver Drowsiness detection using OpenCV and Python | Drowsiness Detection using OpenCV & Machine Learning | Driver Drowsiness Detection System Using Python | Computer vision project | OpenCV Project
With this Python project, we will be making a driver drowsiness detection system. A countless number of people drive on the highway day and night.
Taxi drivers, bus drivers, truck drivers and people traveling long-distance suffer from lack of sleep.
Due to which it becomes very dangerous to drive when feeling sleepy.
The majority of accidents happen due to the drowsiness of the driver.
So, to prevent these accidents we will build a system using Python, OpenCV, and Dlib which will alert the driver when he feels sleepy.
Drowsiness detection is a safety technology that can prevent accidents that are caused by drivers who fell asleep while driving.
The objective of this intermediate Python project is to build a drowsiness detection system that will detect that a person’s eyes are closed for a few seconds.
This system will alert the driver when drowsiness is detected.
Download the Source Code for Driver Drowsiness Detection in Python
Please download the source code for the Project using the link: drive.google.com/drive/folder...
The requirement for this Python project is a webcam through which we will capture images. You need to have Python (3.6 version recommended) installed on your system, then using pip, you can install the necessary packages.
1. OpenCV - pip install opencv-python (Face and eye detection).
2. Imutils - pip install imutils (To get landmarks of eye).
3. Scipy - pip install scipy (To calculate distance between eye landmarks).
4. Pygame - pip install pygame (To play alarm sound).
5. Dlib - pip install dlib
Summary
Hurray! We have successfully built the Driver Drowsiness detection and warning system in Python. In this, we learned the installation and use of OpenCV, Imutils, Scipy,
Pygame and dlib Librarys.
Hope you enjoyed building this project.
_______________________________________________________________________________________________________________________________________________________________
Other Python Projects:
GUI Based Scientific Calculator:- • Scientific GUI Calcula...
Face Detection using Python:- • Real time Face detecti...
GUI Based Music player:- • Learn How to Create an...
GUI Based RU-vid Video Downloader:- • Video
GUI Based Digital clock:- • Create a digital clock...
GUI Based Text Editor:- • Build a basic Text Edi...
Virtual Assistant:- • Build Iron Man Jarvis ...
QR Code Generator and Reader:- • Python Project QR Code...
________________________________________________________________________________________________________________________________________________________________
Connect with me:
Facebook:- / ak.kmr
Instagram:- / ak.kmr111
Email:- akshaydhiman685@gmail.com
_______________________________________________________________________________________________________________________________________________________________
Subscribe:- / @project_guru
#machinelearning #artificialintelligence #drowsiness #python #projectguru

Наука

Опубликовано:

 

6 янв 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 439   
@project_guru
@project_guru 21 день назад
If you are facing "unsupported image type, must be 8bit gray or rgb" issue please install python 3.7. For more details connect over Instagram.
@bharaths6538
@bharaths6538 15 дней назад
Which 3.7 python version?
@project_guru
@project_guru 15 дней назад
@@bharaths6538 any
@endstarcomedy598
@endstarcomedy598 3 дня назад
Bhai iska pura setup per bhi video banao
@qwertykishore
@qwertykishore 2 дня назад
This document is for an old version of Python that is no longer supported. You should upgrade, and read the Python documentation for the current stable release.
@endstarcomedy598
@endstarcomedy598 2 дня назад
@@qwertykishore ame apne school Kai liye ye project bana hai
@ECQ216
@ECQ216 18 дней назад
Literally the best video and the best person that helped me with my project. THANK YOU SO MUCHHH !!!
@project_guru
@project_guru 18 дней назад
Glad you liked it. All the best 💯
@selvalakshmi.a2405
@selvalakshmi.a2405 Год назад
Great working project thank you soooo much
@project_guru
@project_guru Год назад
Glad you liked it!!!!
@vivekkenjale
@vivekkenjale Месяц назад
its working but make a video of how to integrate it in a car 🚗 and also discuss what upgradation we can make in existing system....😌
@punitkirtuniyaYoutube
@punitkirtuniyaYoutube Год назад
Excellent 💡
@project_guru
@project_guru Год назад
Thankyou!!
@stevenzambrano2270
@stevenzambrano2270 9 месяцев назад
Hi, Me again, how can I implement this project in a Jetson nano. Could you give me some advice of how can I use the dlib library on this harware architecture?
@vasika0026
@vasika0026 5 месяцев назад
Excellent it's working 👍
@project_guru
@project_guru 5 месяцев назад
Glad you like it!
@rakeshjoshi4016
@rakeshjoshi4016 Год назад
Good yr
@project_guru
@project_guru Год назад
Thanks brother !!
@poojajoshibaloni6724
@poojajoshibaloni6724 Год назад
Excellent 👍
@project_guru
@project_guru Год назад
Thank you mam!
@dixitraj1109
@dixitraj1109 Год назад
Thanks bro that helped me a lot
@project_guru
@project_guru Год назад
Welcome!
@snjy_mimics
@snjy_mimics 11 месяцев назад
brooooooooo thank u soo much :))))))))))))))))))))
@project_guru
@project_guru 11 месяцев назад
Glad you liked it!!!
@tuhinkumar4397
@tuhinkumar4397 Год назад
While running the alert messeage is not showing nor the alarm is ringing... please help me out . Thank you in advance. It was a great project. can you provide some links for driver face detection while driving ?
@project_guru
@project_guru Год назад
kindly share your code. I can't understand which link are you talking about.
@user-vy4ym7pt3t
@user-vy4ym7pt3t Год назад
can you make the video on installation of dlib library because when i install then this type of error occure ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
@project_guru
@project_guru Год назад
Please install desktop development with C++ package using visual studios. Once done make sure to install cmake using command "pip install cmake" and then install dlib using "pip install dlib".
@tech4tomorrow
@tech4tomorrow Год назад
good work bhaiya can you include yawning in this and how to release camera after showing alert message it is hanging some what
@project_guru
@project_guru Год назад
Definitely, I'll do this by this weekend.
@tanushrikhandare1025
@tanushrikhandare1025 Год назад
Actually i have one question its showing error python exe. M pip install -- upgrade pip for update and run what should I do
@project_guru
@project_guru Год назад
It means a new version of pip is available, you can run the same command to upgrade it but isn't a necessity. There must be a different error message. Kindly check it.
@Studio-gs7ye
@Studio-gs7ye Год назад
Do we have to use multi threading , while playing the music.
@project_guru
@project_guru Год назад
No
@shining_shani
@shining_shani Год назад
Ohh thanks done.....finally ..... what additional features can i add to this project.
@project_guru
@project_guru Год назад
It totally depends on you. You can add anything you want to.
@MuhammadUsama-fl8yv
@MuhammadUsama-fl8yv Год назад
​@@project_gurusir can we add flutter for front end?
@KhushiJain-xx2yk
@KhushiJain-xx2yk 3 месяца назад
I'm getting error in installing dlib.I have installed desktop development with C++ package using visual studios and then run the commands you mentioned for cmake and dlib,still same error comes. Please help me out
@project_guru
@project_guru 3 месяца назад
Please make sure that the 10Gb+ Desktop development with C++ package is properly installed. If the error continues please reinstall python and while installing make sure to build path.
@harshalmali9059
@harshalmali9059 5 месяцев назад
hi sir, i am getting this error (unable to open shape_predictor_68_face_landmarks.dat) what to do?
@project_guru
@project_guru 5 месяцев назад
Kindly install an older version of dlib.
@aakanshakadam7085
@aakanshakadam7085 8 месяцев назад
Can u please just help me with the visual studio thing from the start of the project means after installation what the steps or process
@project_guru
@project_guru 8 месяцев назад
Once installed kindly run it and there you'll find an option to download multiple packages. Kindly choose desktop development with c++
@hemadasari1573
@hemadasari1573 8 месяцев назад
While installing dlib package in pip im getting an error. Plz help me out of this. I tried many times but still encountered the same error
@project_guru
@project_guru 8 месяцев назад
Could you please specify the error?
@jeromshaji
@jeromshaji 6 месяцев назад
sir ,how to find the accuracy of this model
@stevenzambrano2270
@stevenzambrano2270 10 месяцев назад
What kind of training have you made for the *shape_predictor_68_face_landmarks.dat* ?
@project_guru
@project_guru 10 месяцев назад
It's a pretrained model available over the web and is used to predict human face.
@avignesh566
@avignesh566 Год назад
Hi after installing visual studio with C++ i'am getting error i'am unable to install dlib can you help me out pls
@project_guru
@project_guru Год назад
Kindly brief me about the error you are getting.
@user-ui4dv7kl3r
@user-ui4dv7kl3r 11 месяцев назад
I have installed the imutils even its showing module not found .. Iam executing the code in IDLE
@project_guru
@project_guru 11 месяцев назад
Kindly check if you have added python to the path or not.
@emiryldz337
@emiryldz337 7 месяцев назад
The project works very well, but neither the error message nor the music part works. I don't get any errors in the code either. Can you help me?
@project_guru
@project_guru 6 месяцев назад
Did you checked if the frame count is exceeding the limit entered?
@emiryldz337
@emiryldz337 6 месяцев назад
How can I check this for my laptop?@@project_guru
@muhammadsalem9924
@muhammadsalem9924 10 месяцев назад
Great job sir... I want to create a separate system to implement this project. Can I use ESP32 instead of Raspberry pi ? Please reply
@project_guru
@project_guru 10 месяцев назад
Yeah you can use that
@sabrinechouaib2846
@sabrinechouaib2846 2 месяца назад
hey please if you found any source to implement this project on a system tell me !!! i need it
@muhammadsalem9924
@muhammadsalem9924 2 месяца назад
​@@sabrinechouaib2846 Hello, I'm sorry, at first my project was related to the same idea (AI). But later the project was changed by my supervisor and I went towards signal processing. my regards
@sabrinechouaib2846
@sabrinechouaib2846 2 месяца назад
@@muhammadsalem9924 ok thanks ☺️ 🙏
@Sandeepkumar-et3os
@Sandeepkumar-et3os 16 дней назад
Sir ,it's not running in Python 3.12.4 .Its showing the error Error in detection: Unsupported image type, must be 8bit gray or RGB image.Please help
@project_guru
@project_guru 15 дней назад
@@Sandeepkumar-et3os please use python 3.17
@TrayeeNayak
@TrayeeNayak 26 дней назад
I am getting error as unsupported image type, must be 8bit gray or RGB image . And error is in the line "subjects = detect(gray, 0) " even if I have ran the same code . Kindly help
@project_guru
@project_guru 21 день назад
Please install python 3.7.
@jayashreeramesh6990
@jayashreeramesh6990 Год назад
It's not working Where's the mistake not able to find out...after running it's not showing even the error it just displays hello from the pygame community...can plz help
@project_guru
@project_guru Год назад
If it is displaying "Hello from Pygame community" it means the code is running. Kindly check if your primary webcam is working properly or please change the value of VideoCapture(0) to VideoCapture(1) if you are using any additional camera.
@ezhilamudhan9023
@ezhilamudhan9023 Месяц назад
RuntimeError: Unsupported image type, must be 8bit gray or RGB image. i have this error so what can i do
@project_guru
@project_guru Месяц назад
@@ezhilamudhan9023 which version are you using?
@sppujari99
@sppujari99 5 дней назад
​@@project_guru3.12
@BurraShiva25
@BurraShiva25 Год назад
Please music is not inserting no file found in directory,it seems
@project_guru
@project_guru Год назад
please add a music file in the same directory.
@yashneetkaur-rx4gw
@yashneetkaur-rx4gw 2 месяца назад
heyy thank you for your help, my shape predictor file is not opening on pc , so error is occurring and it says syntaxError: (unicode error) 'unicodeescape' codec can't decode and moreover that the file cannot be opened so what should i do ?
@project_guru
@project_guru 2 месяца назад
I believe you are using single backsplash while specifying the path, kindly use double backslashes.
@sonamsahu4807
@sonamsahu4807 Месяц назад
Sir plz Rply face dector 68 wali file run ni ho rahi j​@@project_gurumene use script folder me hi Raha h
@project_guru
@project_guru Месяц назад
@@sonamsahu4807 Please mention kya error a rha hai?
@Garuda-sd3cp
@Garuda-sd3cp 5 месяцев назад
im getting this command sir what do i do C:\Users\venka>pip install opencv-python 'pip' is not recognized as an internal or external command, operable program or batch file. please kindly help me i dont know how to process this
@project_guru
@project_guru 4 месяца назад
Kindly reinstall python
@nehaayesha1623
@nehaayesha1623 Год назад
sir i am getting dlib not defined error even though i installed dlib successfully
@project_guru
@project_guru Год назад
Which code editor/IDE are you using?
@Aditya-cn8pd
@Aditya-cn8pd Год назад
Unable to open shape_predictor_68_face_landmarks.dat file Error please helpp
@project_guru
@project_guru Год назад
Please mention the dlib version you are working with.
@KPriyanka-js9qj
@KPriyanka-js9qj 3 месяца назад
I have installed cmake even though I am getting error in installing dlib library can you please help and can you tell where can i get shape predictor face landmarks file
@project_guru
@project_guru 3 месяца назад
What kind of an error are you getting? Link to download landmark file is attached in the description of the video.
@cisemayaz6662
@cisemayaz6662 6 месяцев назад
what if my head drops infront of me , it doesnt recognize the eyes so doesnt give the alert
@project_guru
@project_guru 6 месяцев назад
Camera should be strategically placed in such a position that it anyhow capture the eyes but yeah in any scenario if the eyes aren't captured a condition for playing alarm can be implemented.
@nikitabhalke6014
@nikitabhalke6014 25 дней назад
Failed to build installable wheels for some project.toml based projects (dlib)😭😭 plz help me
@project_guru
@project_guru 25 дней назад
@@nikitabhalke6014 kindly install desktop development with C++ package using visual studios.
@AKASHUC-wl8pw
@AKASHUC-wl8pw 4 месяца назад
Which app we should run the program pycharm or virtual studio
@project_guru
@project_guru 4 месяца назад
Either would go.
@bhanutejacherupally2797
@bhanutejacherupally2797 Год назад
Dlib not installing bro please help me getting legacy-install-failure error
@project_guru
@project_guru Год назад
Kindly install the dependencies required to install dlib. Download and install Visual studios, run it and install Desktop development using c++ package after that install 'cmake' using 'pip install cmake' and finally 'dlib' using 'pip install dlib'.
@project_guru
@project_guru Год назад
Try upgrading your pip as well.
@sivaselvi9447
@sivaselvi9447 Год назад
Sir ... firstly thank u for full explanation of this project...this is the first project I'm gonna do...but I'm not able to download shape_predictor_68...dat file from modules i don't know why can u please help me with this sir...
@project_guru
@project_guru Год назад
It could be a network issue on your end, Kindly try again and if you still face issue you can drop me a message on my email and i'll forward you the file.
@sivaselvi9447
@sivaselvi9447 Год назад
Sir i downloaded the file but i was unable to open it since it was in dat format...is that a problem...and I'm getting runtime error as unable to open the file models/shape_predictor_68.dat
@project_guru
@project_guru Год назад
@@sivaselvi9447 Kindly check if your code contains the correct path of the file.
@sivaselvi9447
@sivaselvi9447 Год назад
@@project_guru thank you so much sir now i got it fixed i redownloaded the dat file from other source and the problem got fixed up.... thankyou so much for replying for every queries sir....
@project_guru
@project_guru Год назад
@@sivaselvi9447 welcome
@djdhanush9369
@djdhanush9369 10 месяцев назад
Superb bro its working🎉.... But need to know that what is in that dat file it was not opening in my window can you help me please
@project_guru
@project_guru 10 месяцев назад
It contains the model learning. There is no need to open it.
@djdhanush9369
@djdhanush9369 10 месяцев назад
@@project_guru ohk bro....but i need to know what is in that file .... It can help me for review purpose.... Please help me
@djdhanush9369
@djdhanush9369 10 месяцев назад
​@@project_guruplease reply bro
@project_guru
@project_guru 10 месяцев назад
@@djdhanush9369 It contains the pre trained face recognition data or in other words it contains the knowledge of model.
@shining_shani
@shining_shani Год назад
Sir, please make a video on how to reinstall python and all its libraries for this project. like starting from scratch
@project_guru
@project_guru Год назад
Sure!
@tanishdhangar3184
@tanishdhangar3184 Год назад
@@project_guru Sir please make a video on how to build this project from scratch. From downloading python to downloading all the Libraries. Your help is needed sir 🙏🙏
@project_guru
@project_guru Год назад
@@tanishdhangar3184 This is from scratch bro...
@vedantnaikwadi5394
@vedantnaikwadi5394 3 месяца назад
how to yawn detection also in it and also a message system if driver eyes is closed till=5 sec my professor told be to this plz guide
@project_guru
@project_guru 3 месяца назад
Please drop me an email and I will send you the code that includes yawn detection as well.
@saishreer.narendra6446
@saishreer.narendra6446 4 месяца назад
Where are you writing the codes? Which app? How to run it? It does not run on the python command prompt! How to run it?
@project_guru
@project_guru 4 месяца назад
I am using Idle but you can run on any IDE.
@rinkisharma5334
@rinkisharma5334 6 месяцев назад
I am not able to open the shape predictor (Runtime Error: Unable to open shape_predictor_68_face_landmarks.dat)
@project_guru
@project_guru 6 месяцев назад
Which version of dlib are you on?
@rinkisharma5334
@rinkisharma5334 6 месяцев назад
@@project_guru 19.24.2
@rinkisharma5334
@rinkisharma5334 6 месяцев назад
19.24.2 @@project_guru
@keerthikolla9096
@keerthikolla9096 Год назад
I am not getting this and tomorrow is my review in my college can u help me with the errors
@project_guru
@project_guru Год назад
Please tell me the errors you are facing.
@tejaswankhede5689
@tejaswankhede5689 9 месяцев назад
Thank you for the project. Can you please kindly provide me project report for this project as it will help me in college project submission.
@project_guru
@project_guru 9 месяцев назад
Sure, please share your email id.
@itz_mikhael
@itz_mikhael 3 месяца назад
Please I need the report sir
@emiryldz337
@emiryldz337 5 месяцев назад
How can ı count my pc frame how can ı check it?
@lovekeshjain5327
@lovekeshjain5327 8 месяцев назад
hi i am getting this error (unable to open shape_predictor_68_face_landmarks.dat) what to do?
@project_guru
@project_guru 8 месяцев назад
Which version of dlib are you using?
@room5079
@room5079 5 месяцев назад
@@project_guru how to check i am also getting same error
@project_guru
@project_guru 5 месяцев назад
@@room5079 which version of dlib are you on?
@room5079
@room5079 5 месяцев назад
@@project_guru solved bro thanks for your reply😊
@keldaalonso6226
@keldaalonso6226 8 месяцев назад
How can I deploy this on an AI camera sir?? Any tuto on that yet?? As in to make a live copy of this to test in a car?
@project_guru
@project_guru 8 месяцев назад
You can use it via any microprocessor like Arduino and or raspberry pi
@AchmadArif-m5q
@AchmadArif-m5q Месяц назад
Sorry sir, my program error here line 33, in subjects = detect(gray, 0) ^^^^^^^^^^^^^^^ RuntimeError: Unsupported image type, must be 8bit gray or RGB image. Please help me out
@project_guru
@project_guru Месяц назад
@@AchmadArif-m5q kindly share your code.
@anshulghanghoria5767
@anshulghanghoria5767 Год назад
can we use jupyter notebook?? @Project Guru
@project_guru
@project_guru Год назад
Yes you can.
@amruthgowda2750
@amruthgowda2750 7 месяцев назад
Can you please tell which ide u used for this project
@project_guru
@project_guru 7 месяцев назад
I am not using any IDE. I am using python Idle for this.
@asnajalal5658
@asnajalal5658 Год назад
Very useful Sir, This is my project & I came with some error in the code. Could you please provide the source code of this program
@project_guru
@project_guru Год назад
The link to it is available in the description box.
@parthshub5164
@parthshub5164 Год назад
Hey where have you uploaded that landmark.dat file Plz reply ASAP I have to submit my prj within this week
@project_guru
@project_guru Год назад
I have attached the link in the description box.
@balramray2225
@balramray2225 Год назад
Thaks Sir. Can you please provide report on it .
@project_guru
@project_guru Год назад
Please share your Email I'd.
@itz_mikhael
@itz_mikhael 3 месяца назад
@@project_guru please sir i would also like the report
@Prakash0418
@Prakash0418 14 дней назад
​@@project_guru Sir can you send report of this project
@project_guru
@project_guru 11 дней назад
@@itz_mikhael sure please share your e-mail I'd.
@project_guru
@project_guru 11 дней назад
@@Prakash0418 please share your e-mail I'd.
@610sreeyutha9
@610sreeyutha9 8 месяцев назад
i am not able to open the shape predictor. (RuntimeError: Unable to open shape_predictor_68_face_landmarks.dat)
@project_guru
@project_guru 8 месяцев назад
Please share your python and dlib version.
@610sreeyutha9
@610sreeyutha9 8 месяцев назад
@@project_guru I got it bro can u share me the documentation of this project
@project_guru
@project_guru 8 месяцев назад
@@610sreeyutha9 kindly share your email id.
@user-ei5nn1mj8s
@user-ei5nn1mj8s 5 месяцев назад
when i close my eyes i dont get alert message and alarm doesn ring'
@project_guru
@project_guru 5 месяцев назад
Kindly share your source code.
@RishiKesavaReddy
@RishiKesavaReddy 3 месяца назад
Unable to open the shape predictor file run time error
@project_guru
@project_guru 3 месяца назад
Please make sure dlib is properly installed.
@JEEVAHARINIKB
@JEEVAHARINIKB 2 месяца назад
I want to know the accuracy of the model is that possible?
@project_guru
@project_guru 2 месяца назад
You can test the model under various conditions (lightning, distance from camera, different face types, age) to calculate the final accuracy of the model.
@snehadogganal844
@snehadogganal844 Месяц назад
Sir, plz help me to get rid of this error, it shows like: unable to open shape _predictor_68_face_landmarks.dat. And my dlib version is 19.24.99, and python version is 3.12.4
@project_guru
@project_guru Месяц назад
@@snehadogganal844 kindly install dlib 19.24.4 by running command pip install dlib==19.24.4
@Computerscience-bd6qq
@Computerscience-bd6qq 27 дней назад
@@project_guru still it was not runinmg
@project_guru
@project_guru 27 дней назад
@@Computerscience-bd6qq have you passed the file path correctly?
@karanpandey1349
@karanpandey1349 Год назад
Hey, thanks for this project. But I am getting a error: Could not build wheels for dlib, which is required to install pyproject.toml-based project. Please help me out with this.
@project_guru
@project_guru Год назад
Have you installed desktop development with C++ package?
@karanpandey1349
@karanpandey1349 Год назад
@@project_guru Yes I did that. But nevermind, the issue is resolved now. I manually downloaded it using the dlib binary file. 👍🏻
@project_guru
@project_guru Год назад
@@karanpandey1349 perfect!
@t-rex443
@t-rex443 7 месяцев назад
Sir. I got error. It says unable to open shape_predictor_68_face_ landmarks.dat file. How I should solve it.
@project_guru
@project_guru 7 месяцев назад
Please install older version of dlib
@t-rex443
@t-rex443 7 месяцев назад
@@project_guru and how should I download the old version of dlib. And specific process or steps for it?
@130_sreetomamukherjee4
@130_sreetomamukherjee4 3 месяца назад
can you please tell on which platform you are doing the code like jupyter , visual studio code etc
@project_guru
@project_guru 3 месяца назад
I am using Python IDLE but you can use any IDE.
@130_sreetomamukherjee4
@130_sreetomamukherjee4 3 месяца назад
@@project_guru Thank you sir. The program is running properly. Thanks alot sir.
@project_guru
@project_guru 3 месяца назад
@@130_sreetomamukherjee4 Welcome!
@user-bk4zv5hv8k
@user-bk4zv5hv8k 7 месяцев назад
Thank you, sir, in advance. But i face some problem in my code , it didn't show the alert massage and the music when i run the code.
@user-bk4zv5hv8k
@user-bk4zv5hv8k 7 месяцев назад
import cv2 import imutils from imutils import face_utils import dlib from scipy.spatial import distance from pygame import mixer mixer.init() mixer.music.load("music.wav") def eye_aspect_ratio(eye): A=distance.euclidean(eye[1],eye[5]) B=distance.euclidean(eye[2],eye[4]) C=distance.euclidean(eye[0],eye[3]) ear=(A + B) / (2.0)*C return ear thresh=0.25 flag=0 frame_check=20 (lStart,lEnd)=face_utils.FACIAL_LANDMARKS_68_IDXS['left_eye'] (rStart,rEnd)=face_utils.FACIAL_LANDMARKS_68_IDXS['right_eye'] detect =dlib.get_frontal_face_detector() predict=dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") cap=cv2.VideoCapture(0) while True: ret,frame=cap.read() frame=imutils.resize(frame, width=450) gray=cv2.cvtColor(frame,cv2.COLOR_BGR2GRAY) subjects = detect(gray,0) for subject in subjects: shape=predict(gray,subject) shape=face_utils.shape_to_np(shape) leftEye=shape[lStart:lEnd] rightEye=shape[rStart:rEnd] leftEar=eye_aspect_ratio(leftEye) rightEar=eye_aspect_ratio(rightEye) ear=(leftEar+rightEar)/2.0 leftEyeHull=cv2.convexHull(leftEye) rightEyeHull=cv2.convexHull(rightEye) cv2.drawContours(frame,[leftEyeHull],-1,(0,255,0),1) cv2.drawContours(frame,[rightEyeHull],-1,(0,255,0),1) if ear=frame_check: cv2.putText(frame,"*****ALERT*****",(10,30),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,0,255),2) cv2.putText(frame,"*****ALERT*****",(10,325),cv2.FONT_HERSHEY_SIMPLEX,0.7,(0,0,255),2) mixer.music.play() else: flag=0 cv2.imshow("Frame",frame) key=cv2.waitKey(1) & 0xFF if key==ord("q"): break cv2.destroyAllWindows() cap.release()
@user-bk4zv5hv8k
@user-bk4zv5hv8k 7 месяцев назад
can you help me out from this
@project_guru
@project_guru 7 месяцев назад
@@user-bk4zv5hv8k kindly share your source code.
@ayushbhanja7640
@ayushbhanja7640 3 месяца назад
i dont know why imutil is not getting install in my cmd
@project_guru
@project_guru 3 месяца назад
Please specify the error you are getting.
@user-ui8ct9qq1u
@user-ui8ct9qq1u Год назад
sir,How to solve this error ERROR: Failed building wheel for dlib Failed to build dlib ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
@project_guru
@project_guru Год назад
Please install desktop development with C++ package.
@battulajagadeesh8895
@battulajagadeesh8895 Год назад
@project_guru sir even though i have installed c++ package in visual studio i am getting the same error that above one said can you please tell me a solution for this sir
@project_guru
@project_guru Год назад
@@battulajagadeesh8895 which version of python are you using?
@battulajagadeesh8895
@battulajagadeesh8895 Год назад
@@project_guru 3.11
@Musab.Mohamed
@Musab.Mohamed Год назад
Are you using pycham editor for dis project ?
@project_guru
@project_guru Год назад
I used IDLE here but you can prefer PyCharm as well.
@Aditya-cn8pd
@Aditya-cn8pd Год назад
Unable to open predictor file error please help sir
@project_guru
@project_guru Год назад
Which version of dlib are you working with?
@user-ei5nn1mj8s
@user-ei5nn1mj8s 5 месяцев назад
kindly helpp
@ammuzz5910
@ammuzz5910 День назад
Is web cam necessary
@kiritokun4098
@kiritokun4098 Год назад
Sir, could you pls provide the documentation or report of this project? Thanks so much...
@project_guru
@project_guru Год назад
Yeah definitely, kindly ping me via fb/Instagram or kindly drop me a mail and I'll forward it to you.
@nitishsharma7545
@nitishsharma7545 Год назад
​@@project_guru sir can u plzzzz send ur Facebook Id...
@project_guru
@project_guru Год назад
@@nitishsharma7545 facebook.com/ak.kmr
@brajesh5635
@brajesh5635 Год назад
@@project_guru can I please have your mail-id for documentation
@project_guru
@project_guru Год назад
@@brajesh5635 yeah it's akshaydhiman685@gmail.com
@shaniyadav33
@shaniyadav33 Год назад
while installing dlib i get an error error: legacy-install-failure
@project_guru
@project_guru Год назад
Did you installed cmake?
@shaniyadav33
@shaniyadav33 Год назад
@@project_guru yes
@shaniyadav33
@shaniyadav33 Год назад
But "CMake must be installed to build dlib" tab bhi dikha rha tha Error me
@shaniyadav33
@shaniyadav33 Год назад
now those "import not resolved" and all other errors are resolved but there is some "inconsistent use of tabs and spaces in indentation" error in my python file. How to get rid of these errors?
@shaniyadav33
@shaniyadav33 Год назад
Actually I got rid of that error... But now I am getting "runtime error: unable to open shape_predictor_68_face_landmarks.dat" error .
@bikashsasmal1156
@bikashsasmal1156 10 месяцев назад
sir in our college we have this project is using AI ML how can i do please suggest me
@project_guru
@project_guru 10 месяцев назад
I have done that project as well. Kindly share your email and I'll revert back with the source code.
@zaherabegum1808
@zaherabegum1808 3 месяца назад
Please share me the source code too using ai/ml
@mohammedsharfuddin1652
@mohammedsharfuddin1652 7 месяцев назад
Sir,How it is implemented in real time?..how can I demonstrate its working ?
@project_guru
@project_guru 7 месяцев назад
You can demonstrate it's working the way it's shown here.
@harshitasrivastava1463
@harshitasrivastava1463 2 месяца назад
hi, can i get the project report for this?
@project_guru
@project_guru 2 месяца назад
Sure please drop me an email on akshaydhiman685@gmail.com
@JAYYASRIS
@JAYYASRIS Год назад
Sir, the output is showing as 1 constantly and it is not changing. If I close the eyes, the alert sound is not heard. Please do help to rectify this error
@project_guru
@project_guru Год назад
Kindly increment flag value by 1 with every frame. Check your code. if ear < thresh: flag+=1 . . .
@JAYYASRIS
@JAYYASRIS Год назад
@@project_guru I checked the code but still it is showing the same as 1
@project_guru
@project_guru Год назад
@@JAYYASRIS Kindly share the code.
@JAYYASRIS
@JAYYASRIS Год назад
@@project_guru Here is the code Sir import cv2 import imutils import dlib from scipy.spatial import distance from imutils import face_utils from imutils import resize from pygame import mixer mixer.init() mixer.music.load("music.wav") def eye_aspect_ratio(eye): A = distance.euclidean(eye[1], eye[5]) B = distance.euclidean(eye[2], eye[4]) C = distance.euclidean(eye[0], eye[3]) ear = (A + B) / (2.0 * C) return ear thresh = 0.25 frame_check = 20 flag=0 (lStart, lEnd) = face_utils.FACIAL_LANDMARKS_68_IDXS["left_eye"] (rStart, rEnd) = face_utils.FACIAL_LANDMARKS_68_IDXS["right_eye"] detect = dlib.get_frontal_face_detector() predict = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") cap=cv2.VideoCapture(0) while True: ret, frame=cap.read() frame = imutils.resize(frame, width=450) gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) subjects = detect(gray, 0) for subject in subjects: shape = predict(gray, subject) shape = face_utils.shape_to_np(shape) leftEye = shape[lStart:lEnd] rightEye = shape[rStart:rEnd] leftEAR = eye_aspect_ratio(leftEye) rightEAR = eye_aspect_ratio(rightEye) ear = (leftEAR + rightEAR) / 2.0 leftEyeHull = cv2.convexHull(leftEye) rightEyeHull = cv2.convexHull(rightEye) cv2.drawContours(frame, [leftEyeHull], -1, (0, 255, 0), 1) cv2.drawContours(frame, [rightEyeHull], -1, (0, 255, 0), 1) if ear < thresh: flag += 1 print (flag) if flag >= frame_check: cv2.putText(frame, "****************ALERT!****************", (10, 30),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) cv2.putText(frame, "****************ALERT!****************", (10,325),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) mixer.music.play() else: flag = 0 cv2.imshow("Frame", frame) if cv2.waitKey(1) & 0xFF == ord("q"): break cv2.destroyAllWindows() cap.release()
@JAYYASRIS
@JAYYASRIS Год назад
@@project_guru Here is the code Sir. import cv2 import imutils import dlib from scipy.spatial import distance from imutils import face_utils from imutils import resize from pygame import mixer mixer.init() mixer.music.load("music.wav") def eye_aspect_ratio(eye): A = distance.euclidean(eye[1], eye[5]) B = distance.euclidean(eye[2], eye[4]) C = distance.euclidean(eye[0], eye[3]) ear = (A + B) / (2.0 * C) return ear thresh = 0.25 frame_check = 20 flag=0 (lStart, lEnd) = face_utils.FACIAL_LANDMARKS_68_IDXS["left_eye"] (rStart, rEnd) = face_utils.FACIAL_LANDMARKS_68_IDXS["right_eye"] detect = dlib.get_frontal_face_detector() predict = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat") cap=cv2.VideoCapture(0) while True: ret, frame=cap.read() frame = imutils.resize(frame, width=450) gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) subjects = detect(gray, 0) for subject in subjects: shape = predict(gray, subject) shape = face_utils.shape_to_np(shape) leftEye = shape[lStart:lEnd] rightEye = shape[rStart:rEnd] leftEAR = eye_aspect_ratio(leftEye) rightEAR = eye_aspect_ratio(rightEye) ear = (leftEAR + rightEAR) / 2.0 leftEyeHull = cv2.convexHull(leftEye) rightEyeHull = cv2.convexHull(rightEye) cv2.drawContours(frame, [leftEyeHull], -1, (0, 255, 0), 1) cv2.drawContours(frame, [rightEyeHull], -1, (0, 255, 0), 1) if ear < thresh: flag += 1 print (flag) if flag >= frame_check: cv2.putText(frame, "****************ALERT!****************", (10, 30),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) cv2.putText(frame, "****************ALERT!****************", (10,325),cv2.FONT_HERSHEY_SIMPLEX, 0.7, (0, 0, 255), 2) mixer.music.play() else: flag = 0 cv2.imshow("Frame", frame) if cv2.waitKey(1) & 0xFF == ord("q"): break cv2.destroyAllWindows() cap.release()
@durga.r8735
@durga.r8735 4 месяца назад
Which algorithm is used in this project
@project_guru
@project_guru 4 месяца назад
HOG
@himanshidwivedi3800
@himanshidwivedi3800 5 месяцев назад
its showing "Unable to open models/shape_predictor_68_face_landmarks.dat" error i have downloaded the dat file then too its showing error
@project_guru
@project_guru 5 месяцев назад
Have you installed dlib?
@Sana-uf8jq
@Sana-uf8jq 4 месяца назад
sir i have the same issue , and i have downloaded all the libraries@@project_guru
@Sana-uf8jq
@Sana-uf8jq 4 месяца назад
okay i was able to fix the issue but i have noticed the detection isn't 100% accurate, like when i wear glasses or look down it starts to beep. is there anyway to increase the accuracy
@project_guru
@project_guru 4 месяца назад
@@Sana-uf8jq while looking down it seems like the EAR's value decreases hence it plays alarm. In real world it could be considered as a sign of fatigue so playing alarm would be crucial.
@project_guru
@project_guru 4 месяца назад
@@Sana-uf8jq Coming towards glasses it doesn't have any problem with that. It does work pretty smoothly even with glasses on.
@birundhadevi5439
@birundhadevi5439 5 месяцев назад
Sir, i run the code but the camera could not open sir. What can i do
@project_guru
@project_guru 5 месяцев назад
Is it displaying any error?
@user-sf1wj4wy7c
@user-sf1wj4wy7c Год назад
Sir, can you please give me a report based on these project
@project_guru
@project_guru Год назад
Sure, please share your email I'd.
@RAMKUMAR-y9k
@RAMKUMAR-y9k 26 дней назад
TypeError : shape = predict(gray, subjects) Pls help to get out from this error
@project_guru
@project_guru 26 дней назад
@@RAMKUMAR-y9k kindly email me the source code at akshaydhiman685@gmail.com
@growbottofficial
@growbottofficial 26 дней назад
I have an error :" unsupported image type ,it must be gray or 8bit RGB "
@project_guru
@project_guru 26 дней назад
@@growbottofficial kindly install an older version of dlib.
@omkar1370
@omkar1370 25 дней назад
@@project_guru i am getting the same error. if tried to install dlib version 19.24.4 am getting this error ERROR: Failed building wheel for dlib Failed to build dlib ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (dlib)
@growbottofficial
@growbottofficial 25 дней назад
​@@project_guru can't install
@project_guru
@project_guru 25 дней назад
@@omkar1370 let's connect via Anydesk this weekend and I'll install it.
@project_guru
@project_guru 25 дней назад
@@growbottofficial what error are you getting?
@AshuAshu-ne7yh
@AshuAshu-ne7yh Год назад
Sir couldn't open shape predictior landmark datasets please help me sir
@project_guru
@project_guru Год назад
Please share the exact error message you are getting.
@AshuAshu-ne7yh
@AshuAshu-ne7yh Год назад
Dlib.shape_predictor("model/shape_predictor_68_face_landmarks.dat Error unable to open model/shape prictor
@AshuAshu-ne7yh
@AshuAshu-ne7yh Год назад
Shape predictior Can't open sir plz help me sir
@project_guru
@project_guru Год назад
kindly check the path of the shape prediction file.
@sahithiprathyusha1992
@sahithiprathyusha1992 Год назад
Can i Know which platform ur using for coding?
@project_guru
@project_guru Год назад
I am using IDLE but you can choose any IDE.
@prajwaljain2657
@prajwaljain2657 Год назад
no module named cv2 error
@project_guru
@project_guru Год назад
Kindly install OpenCV. Run Command 'pip install opencv-python' in cmd for the same.
@user-fz4og9ob4u
@user-fz4og9ob4u Год назад
May I know in which software you have done this project
@project_guru
@project_guru Год назад
I used IDLE but you can choose any editor/IDE.
@anshulghanghoria5767
@anshulghanghoria5767 Год назад
​@@project_guru can we use jupyter notebook
@project_guru
@project_guru Год назад
@@anshulghanghoria5767 Yes you can.
@nitishsharma7545
@nitishsharma7545 Год назад
​@@project_guru sir please provide you Facebook ID... Sir can you please provide documentation or report for this project.. please sir
@project_guru
@project_guru Год назад
@@nitishsharma7545 Here it is facebook.com/ak.kmr Yeah definitely I'll provide you the documentation.
@SaulGoodman371
@SaulGoodman371 7 месяцев назад
I have a problem with compile with music.wav
@project_guru
@project_guru 7 месяцев назад
Please specify the error
@phatannaziya6511
@phatannaziya6511 16 дней назад
If We excute this code using python-3. 12 ??
@project_guru
@project_guru 15 дней назад
@@phatannaziya6511 python 3.12 will use newer version of dlib which doesn't have some of the required functions.
@phatannaziya6511
@phatannaziya6511 15 дней назад
We install modules in any version or specific version is there for this project
@tanushrikhandare1025
@tanushrikhandare1025 Год назад
But i am getting error Module not found error No module name scipy pls resolve this
@tanushrikhandare1025
@tanushrikhandare1025 Год назад
Plz reply fast as soon as possible
@project_guru
@project_guru Год назад
kindly install it using command "pip install scipy"
@tanushrikhandare1025
@tanushrikhandare1025 Год назад
I already installed still showing same issue
@project_guru
@project_guru Год назад
@@tanushrikhandare1025 which IDE are you using?
@tanushrikhandare1025
@tanushrikhandare1025 Год назад
@@project_guru 3.11
@mohamedyusufcse4754
@mohamedyusufcse4754 3 месяца назад
Can I get report pdf for this
@project_guru
@project_guru 3 месяца назад
Sure, please drop me an email at akshaydhiman685@gmail.com
@deepakdee4166
@deepakdee4166 28 дней назад
Unsupported image type, must be 8bit gray or rgb image
@project_guru
@project_guru 21 день назад
Please install python 3.7
@sahithiprathyusha1992
@sahithiprathyusha1992 11 месяцев назад
How can i download the first two files and how to insert them
@project_guru
@project_guru 11 месяцев назад
You can download the files from the link available in description box, simply copy paste them in your project folder in order to attach them.
@sahithiprathyusha1992
@sahithiprathyusha1992 10 месяцев назад
I couldn't find them in description box can u comment them below
@project_guru
@project_guru 10 месяцев назад
@@sahithiprathyusha1992 here it is drive.google.com/drive/mobile/folders/1uMQpBDky9NCcCgfmOpDiQr5p-xttdvPU?usp=sharing
@saakshishetty2448
@saakshishetty2448 29 дней назад
Error Unsupported image type ,8bit gray or rgb image
@project_guru
@project_guru 28 дней назад
which version are you working on?
@saakshishetty2448
@saakshishetty2448 28 дней назад
@@project_guru python 3.12.4
@saakshishetty2448
@saakshishetty2448 28 дней назад
​@@project_guru python version 3.12
@arunasalam.r7396
@arunasalam.r7396 Год назад
hii sir please provide IEEE paper pdf 2021 or 2022
@project_guru
@project_guru Год назад
Sorry, I don't have that.
@5c4sriram50
@5c4sriram50 3 месяца назад
Bro I need documentation for this project pls
@project_guru
@project_guru 3 месяца назад
Kindly share your email id
@andrewbola7494
@andrewbola7494 Год назад
Love the work. How do i add a registration and login page to your system?
@project_guru
@project_guru Год назад
You can use Django for that.
@andrewbola7494
@andrewbola7494 Год назад
​@project_guru can you create a video for that please? I am just learning
@project_guru
@project_guru Год назад
@@andrewbola7494 Sure!
@andrewbola7494
@andrewbola7494 Год назад
@@project_guru thanks
@project_guru
@project_guru Год назад
@@andrewbola7494 Welcome!!!
@rockingrockgaming6293
@rockingrockgaming6293 7 месяцев назад
Sir this .dat file is not working now except that everything is fine kindly please provide me the working .dat file
@rockingrockgaming6293
@rockingrockgaming6293 7 месяцев назад
I have properly download it and provide each and every step but at end it shows "exception has occurred:runtime error ""unable to open shape_director_68_phase_landmarks.dat"
@rockingrockgaming6293
@rockingrockgaming6293 7 месяцев назад
It's show error at Time of execution exception error file is unable to open
@project_guru
@project_guru 7 месяцев назад
@@rockingrockgaming6293 which version of dlib are you using?
@rockingrockgaming6293
@rockingrockgaming6293 7 месяцев назад
Latest one
@rockingrockgaming6293
@rockingrockgaming6293 7 месяцев назад
@@project_guru latest one ,I tried everyone version of this project but all of them show that this .dat file is unable to open and all my college friend are facing same problems, .dat file having some problem
Далее
ТЫ С ДРУГОМ В ДЕТСТВЕ😂#shorts
01:00
Survive 100 Days In Nuclear Bunker, Win $500,000
32:21
Я НЕ ОЖИДАЛ ЭТОГО!!! #Shorts #Глент
00:19
Facial Recognition attendance system using python
19:44
Deep Drowsiness Detection using YOLO, Pytorch and Python
1:18:35
Xylon Driver Drowsiness Detection Demonstration
2:27
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 844 тыс.
Drivers Drowsiness Detection using Deep Learning
2:55:30
This is why Deep Learning is really weird.
2:06:38
Просмотров 377 тыс.
Это iPhone 16
0:52
Просмотров 416 тыс.