Realtime Drowsiness and Yawn Detection using Python in Raspberry Pi or any other PC
ฝัง
- เผยแพร่เมื่อ 28 ก.ย. 2024
- In this video I will show you, how to implement a Drowsiness and Yawn Detector using Python. We will use libraries like OpenCV, DLIB etc. And this will work on Raspberry Pi or any other regular PC.
Download Code and Required files:
github.com/Ari...
Commands used in this video:
sudo apt-get install python3-scipy
sudo apt-get install espeak
pip3 install imutils
pip3 install argparse
pip3 install numpy
git clone github.com/Ari...
DLIB Installation Video:
• Easiest way to install...
OpenCV Installation Video:
• Easiest way to install...
Pyimagesearch Blog
www.pyimagesea...
For future updates follow us on facebook: / sparklers2018
Nice bro. Excellent tutorial. Thank you for the good work 👏👏👌
Hai bro
can you tell that how that voice is generated
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Those working in windows, use playsound module of python for voice alerts. Its working..
Getting an error while installing dlib
Install add the path espeak
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer@@ramyabandaru2733
Thanks for the amazing explanation ❤️🙏
Thank you so much. By the way, when I run the file, an error occurred. It said Numpy version different. In my Raspi I installed version 2.0 but in the code need version below 2.0. I'm not sure if I understand it correctly. Please help.
Great video guys. Does the development you did work to detect Drowsiness and Yawn at night? Should I use some kind of camera with night vision?
Yes, you can use a night vision camera for that.
@@SPARKLERSWeAreTheMakers Thank you very much. I did several tests with Raspbeerry 3 B+, and it doesn't detect this exactly. This is very slow and inaccurate in the dark. I use an advanced usb camera with infrared, night vision that I connect to the raspberry. This USB camera works well in the dark but on my laptop, but on the raspberry it does not work well in the dark. Comparing with my laptop, my laptop is much faster, so if I work well on the laptop, but on the raspberry it is very slow and has deficiencies and does not detect well, it is not accurate.
1. Do you have an idea if with a faster micro SD memory it already solves the problem
2. Or is it better to use raspberry 4 B, and which raspberry 4 B do you recommend or is it better to detect drowsiness at night, the 2-gigabyte raspberry 4b or the 4-gigabyte?
I have done everything as you said it in the video and eveything went right,but I'm not able to get the frame that you have shown it in the video sir please can you tell me how to do it
Can I use ESP32 instead of Raspberry Pi? Please answer
Ha bro explain me about the alaram what to do if we want to get sound
Did this code work ?
Hs
Hello sir,Please, how can I translate the clip into Arabic.. I hope to reply as soon as possible, and thank you for reading my comment
Which version of python used? because i am getting error while importing the modules like dlib and cv2
python 3 latest
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Is there any RPi at low coat than RPi 3 to run OpenCV for this application?
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
How can I install dlib in pycharm? I tried using python 3.6 and also conda environment. It is still showing error ,Sir.
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Can I use ESP32 instead of Raspberry Pi? Please answer
hi Arijit
thanks for your tutorial it was useful but gtts dose'n support farsi and I have to use the playsound for alarm but if it detect the both of yawn and sleepy eye it play the alarm two time and they get mix up
can you help me what should i do???
What if we connect the buzzer to the raspberry pi can you help me with code to play buzzer if the dirver is drowzy
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Hii sir, Im doing IOT(respberry pi) project on this
So, Can you please tell me the components that are used in this project.
Please reply me fast sir.
Provide me information about components to run only for Respbeery pi not on windows
THANK YOU sir.
Can you show us hardware part as well?
Google say if you install raspberry pi os in your laptop, then it will format the laptop, is it true please reply bro
Hii sir
Which algorithm you can use to build this project
hai , i am using windows to running this code. could you tell me what are you say in Minutes 21:26 .i can't call espeak
U must install and add the path to espeak
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer@@ranjithshetty7078
Command sudo apt-get install espeak not working please reply sir
Can we convert it to an app for Android ???
is there any way to convert this model to tflite to deploy it on ESP32 ? to run it locally?
Can I use ESP32 instead of Raspberry Pi? Please answer
Sir "What is the algorithm Used in This Project"
is it camera work in night without lights? please reply any one
Thank for the video Bro❤️
Hai bro
Dlip i can't install how to solve this
Is that deep learning??
Sir, memory error is occurred and I can't solve it.
Shape=predictor(gray,rect)
Type error: __call__() is not Unfinished ....Also getting this error plzzz give me solution...
Great work thanks. Is that Raspberry Pi 4 or 3?
Raspberry pi 3
@@SPARKLERSWeAreTheMakers how are you getting such good FPS in camera???
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Hey Sir, I am having some problems in using this on raspberry pi.
It is giving this error called
"ImportError : libf77blas.so.3: cannot open the shared file : No such directory"
Can I use ESP32 instead of Raspberry Pi? Please answer
Hey sir...thnks for this tutorial...i have question about yawn detection...what is the equation to calculate yawn value ?
Can I use ESP32 instead of Raspberry Pi? Please answer
Hello sir, very nice work and video. btw, if I want to change the input from webcam to video file, is that possible? and what should I change from the coding? Your prompt reply would be appreciated, sir. Thanks!
Yes, you can do that. Just instead of reading from webcam, read frames from the video. You can use cv2.VideoCapture().
Hai bro
Hai bro
Can I use ESP32 instead of Raspberry Pi? Please answer
Awesome 👍
Hello sir, Very nice video. I understood the coding part, can you please attach the circuit diagram and components used in this project. It will be very helpful for us.
You just need to connect a webcam and speaker with the Raspberry Pi.
@@SPARKLERSWeAreTheMakers hello sir. "need to connect a webcam and speaker" do you refer to the laptop's webcam and speaker or you use raspberry pi camera?
@@SPARKLERSWeAreTheMakers I have executed the code but I am not able to get speaker output from raspberry PI. I installed espeak as well. Is there anything else that I need to do in order to make it work?? Please let me know.
Thank you for uploading such detailed explanation.
@@SPARKLERSWeAreTheMakers I have successfully run the code and also got audio output. But there is a delay in the audio output, I'm getting sound after some lag. Is there any fix for this?? Please share thank you once again for your video.
@@ajayreddy5090 hai bro
How i can run it in windows 10 visual code.?
What i need to do.?
Same problem bro but he is not replying 😢😢😢😢
can we run the project without the use of raspberry pi and a webcam?????
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
which algoritm u used in this project
For drowsiness detection measurement of Eye Aspect Ratio.
Thanks Bhai ❤
Thank you❤
shape = predictor ( gray , rect )
TypeError: 'NoneType' object is not callable
i am getting this error at line 109 pls can you solve bro @sparkles
hello!! sir can i do the same project on raspberry pi Zero W...?
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
I want data set ready
Sir your code is working can you replace espeak with a music.wav file i have a file please provide the code it's my final year project please help sir❤❤❤❤❤
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
There is an error *predictor=dlib.shape_predictor('shape_predictor_68_face_landmarks.dat)
AttributeError: module 'dlib' has no attribute 'shape_predictor.
How to solve it
I'm getting the same error.... Did you find the solution?
Hello, Try Miniconda for installing dlib.
@@harshparmar7704 guys type the full address of the directory /sda/asdad/shap....dat
@@bharathnandan2067 guys type the full address of the directory /sda/asdad/shap....dat
Here I'm getting memory error? How I can solve this?
How to autorun a program in raspberry pi
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer 🌹
is it possible in esp32cam
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Bro.. How can I contact you?
Mail us at sparkler988323@gmail.com
Sabas vai.keep it up
Thank you vai♥️
Hello sir
Please make video on how you setup all application like python it's version , what changes need to do for beingner and as I belong to mechanical want perform to this project . What are basis setup nd installation required on new laptop
In the description of the video, I have clearly mentioned the commands to install all the libraries. And by seeing the commands you should easily understand I have used python3. And for dlib and opencv installation I have separate videos on my channel.
sir how to solve 'espeak' is not recognized as an internal or external command,
operable program or batch file.
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Bro pls help me how to install dlib on python 3.7
i have error using espeak raspberry pi error about alsa !!!!
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer🌹
How i can make espeak work on Windows machine
dlib is not getting installed
what to do?
Hello Sir, do i have to write the - ap.add_argument("-w", "--webcam", type=int, default=0,
help="index of webcam on system") .....command in line 74, if i am using a raspberry pi cam?
hi bro did it work for u???
help me bro i have the same problem....
@@rgt2573 did you got the solution bro?
Having error in importing all lib required and you mentioned
Hey, I also have same problem. Error in importing DLIB library and CB2. How Did you managed to overcome this?
@Varnika Sangwan I got the solution.
I am getting error that shape predictor not found . You have provided the DAT file of shape predictor . Can you please help how can i use that DAT format file to run my error
Can you please change the espeak with music.wav , espeak is showing error
I'm looking for the best eye tracking dataset, do you know where it is?
Can I use ESP32 instead of Raspberry Pi? Please answer
can we do this same project on mobile using pydroid
Can anyone know if this is deep learning or not?
How can i stop that yawning function.. Only run ear function?
I am getting error in this Rects= detector (gray,0) in line 101
Indentation error : unexpected indent plz share the solution
espeak is not working can anyone guide plzz
How to install Dlib in pycharm a complete video plz🙏🙏🙏🙏
espeak is not an intrnal or external command
Hi can we speak over call?
while i am run this code then it will gave error like this (can't open shape_predictor_68_face_landmark.dat ) file
download it on internet, it's like a library.
speaker not recognized "enternal or external" :( can you help solving the speaker issue plz
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
hello bro can u solve my issue please that what i have to do in code for using the normal camera of my laptop
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
While running the git clone it is asking userid and password for githublogin to download
Can u send the userid and psswd...
Hey sir
I have already an frame in video form which i display driver drowsinees detection and I want to add it to my GUI (graphiq user interface) with Tkinter
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
That's a great video and very good explanation SPARKLERS : We Are The Makers. For hardware I have Raspberry PI 4 board, What camera should I use? Will Pi NoIR camera work for this?
Can I use ESP32 instead of Raspberry Pi? Please answer
Great sir.your code is working but alerting through alarm in pc is not getting
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Can you gave me suggestions please...
Hey can we implement this on an android app, using app studio?
amazing project can u add neopixel to this project?
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
could u tell me about the hardware spec? Rpi model and camera spec?
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
can you tell the list of hardware components required with raspberry pi 3 for this project and that espeak works with buzzer or something else is required ????
Can I use ESP32 instead of Raspberry Pi? Please answer
So have you found or think about required objects for this project?
I am getting an error "Attribute Error: Nonetype object has no attribute shape"
Please help
it says can't open camera by index 0
@@prithvirajjain9927 try index 1
thank you for sharing your knowledge
Research paper bhe likha tha kya bro❤️
How can I install dlib in pycharm, getting error in installing dlib after successfully installed cmake, please reply soon brother !!
Hey, Try Miniconda for installing Dlib's and other packages it will help you.
try installing cmake first
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Thanks bro👍👍
Hey, Whole code worked for me but the alarm or espeak showing error. Code is detecting YAWN and showing on screen but no no audio message excited.
hi
can u please tell me how u got the output.i am running the code but it is showing that ..
# if both the width and height are None, then return the
AttributeError: 'NoneType' object has no attribute 'shape'.in shape detector dataset there is no data.
file also not openig.can u please help me
@@sindesasikalabai4185 Maybe because of dependencies. Check you installed necessary packages.
@@harshparmar7704 hi I have the same problem. There is no audio sound. I use Windows pycharm. I have installed the speak3 package. Can you tell me what package to install?
@@jeffreyli3268 according to my research espeak is not working in windows. So replace sound output function using "pygame" with espeak function.
ok
Which Version of Raspberry pi you used?
Raspberry pi 3 B +
@@SPARKLERSWeAreTheMakers I ordered Raspberry pi 4. Can you tell me which camera do you used?
@@SPARKLERSWeAreTheMakers Bro raspberry pi 3 is ok here?
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Great video sir, i tried cloning, but it asks for user name and password, could you help as am working on it, awaiting your quick reply
also now frame window is ot working
Hey bro thanks from Pakistan. Would you tell me that can i use raspberry pi 3 here 2gb version or should i use any other version of raspberry pi. And which camera you use here?
You can use any raspberry pi version in the same way. You can use the 5 MP raspberry pi camera or any webcam.
Can I use ESP32 OR any other solution instead of Raspberry Pi? Please answer
Brother, I need your help to this. Which python did you use here? I tried with latest 3.9 and 3.7 but this wasn't working for me. Actually I'm using PyCharm. My main issue is couln't install opencv-python and dlib to my computer.
Use python 3.6, change the interpreter on the pycharm settings and make virtual environment.
@@athaya_abi Thanks for the reply. Actually It's working now
@@athaya_abi hi bro need your help in executing this project...
@@rgt2573 Hello, I can help you. Just let me know, what the problem is.
dlib is not installing in pycharm
first install cmake and then install dlib