Real-time Drowsiness Detection Tutorial | Transfer Learning | TensorFlow | Python | OpenCV

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • This video contains step by step implementation of drowsiness detections using camera video/image.
    1) Brainstorming, How to detect drowsiness using different methods (Face image, biosignal ) and features (eye status, yawning, nodding, etc.)
    2)Transfer Learning concepts in Deep Learning
    3) Line by line python code implementation for beginners
    In case you are interested in our other videos tutorials, please have a look
    1) Real-time Face Emotion Recognition | Python | OpenCV | Step by Step Tutorial for beginners
    • Realtime Face Emotion ...
    2) Deep Learning - Image Classification Tutorial step by step (for Beginners) (python / TensorFlow)
    • Deep Learning - Image ...

Комментарии • 136

  • @yulongguo2450
    @yulongguo2450 2 года назад +4

    Very helpful and easy understanding.But Sir,there is a problem in your code.When we seperate the features and labels,we should let the X divides 255.0 before we save our features into the file named X.pickle .

  • @davidpoudel8567
    @davidpoudel8567 3 года назад +9

    Where can we get my_model_Drowsiness.h5 model sir?

  • @umairmughal0001
    @umairmughal0001 3 года назад +1

    wow... Explained very well. Advanced research topics these days. It is really amazing

  • @吳建中-o9n
    @吳建中-o9n 3 года назад +2

    final_ouput = layers.Activation ('sigmoid') ( final_output)
    the final_ouput is right? or typing mistake ?

  • @umerusman7720
    @umerusman7720 3 года назад +2

    you are amazing .i wonder why dont u have million subscriber till now. gratitudes sir

  • @tomaszwojciechowski7388
    @tomaszwojciechowski7388 3 года назад +2

    Why haar cascade stop seeing eye when it's closed?

  • @manishsonawane1828
    @manishsonawane1828 Год назад

    Very helpful video. I am going to implement this.
    Is it possible to get the confusion matrix and prescision score? If yes, can you please tell me which parameters/variables to consider from this code?

  • @tarikulislam-jw5fh
    @tarikulislam-jw5fh 2 года назад +1

    @DeepLearning_by_PhDScholar Thank you for your suggestion. We are finding it hard to create folders of open_eyes and Closed_eyes because main dateset contains both of them in each folder. Is it possible for you to share just the open_eyes and closed_eyes dataset.

  • @tejashrilabhsetwar7170
    @tejashrilabhsetwar7170 3 года назад +1

    Sir in which algorithm we have use on this project. ???

  • @saliniu4423
    @saliniu4423 3 года назад +1

    Can you please tell how you create my_model_Drowsiness.h5 model sir?

  • @madhurig3848
    @madhurig3848 3 года назад +1

    Very helpful and easy understanding. I just want to know if there are any challenges to implement same in R programming ?

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      Thank you so much for your interest and sorry for being late in replying. Actually , honestly , my expertise are only in python, c/c++, MATLAB and many others but I did not touch R programming yet as we do have alternative solutions in python. In case you can load the model of tensorFlow in R programming ,then you can do it, just like in opencv , people can upload tensorflow model.. I am not sure about R programming. But deep learning can be performed in Tensorlfow (by google), pytorch(py facebook), CNTK(Microsoft) and many others. I am not sure that you can load trained models which are built and trained in frameworks (Tensorflow etc) and load in programming language such as R programming. I am again sorry that I could not help in this regard. Stay blessed.

    • @madhurig3848
      @madhurig3848 3 года назад +1

      @@deeplearning_by_phdscholar6925 Thank you for your suggestion. I am following your video and trying to do in R. We are finding it hard to create folders of open_eyes and Closed_eyes because main dateset contains both of them in each folder. Is it possible for you to share just the open_eyes and closed_eyes dataset.

  • @723_sahildhuri2
    @723_sahildhuri2 3 года назад +1

    amazing sir,, but i am facing error while doing >model.fit()< any solution

  • @johnericsondulay4038
    @johnericsondulay4038 3 года назад +1

    Sir what are the hardware's used in this project thanks and god bless

  • @akhileshrmadhyastha6400
    @akhileshrmadhyastha6400 3 года назад +3

    How many epochs we have to train to get high accuracy?

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      Thank you for your interest, and sorry for being late in replying, it depends, as in deep learning weights are always initialized randomly, , however here, we have followed transfer learning, so must be few epochs. in case your accuracy is not increase by increasing epoch, you must stop (early stopping). In order to increase your accuracy try changing learning rate(reduce it by half or so), this is one of the method for fine tuning, I hope your accuracy will be increased. In video it was enough for robust testing, Stay blessed

  • @mitalsolanki3327
    @mitalsolanki3327 2 месяца назад

    From where we can find this model??

  • @bintehawa7712
    @bintehawa7712 2 года назад

    Very helpful .we need more videos sir

  • @rahul.gulati
    @rahul.gulati 4 месяца назад

    It would have been great if you had created a link for the segregated dataset which you created.

  • @chemophile14
    @chemophile14 3 года назад +1

    It's very fruitful research study for future-protection of traffic accidents.

    • @yadavchandan3372
      @yadavchandan3372 3 года назад

      in ehich language your name is Shown or Written

  • @LoremIpsum-yt
    @LoremIpsum-yt Год назад

    Will this work if there are multiple faces to detect drowsiness from??

  • @subramanyak6187
    @subramanyak6187 3 года назад +2

    Sir Your explanation was awesome. Please increase the font-size from next time.

  • @jassicasahi3648
    @jassicasahi3648 2 года назад +1

    please provide the link of the dataset

  • @deltastorm7071
    @deltastorm7071 3 года назад +3

    Hey sir, I have watched the entire video and I'm now finding it really hectic to type the entire project, could you please link the source code?

  • @manjunathdasappanavar2913
    @manjunathdasappanavar2913 Год назад

    Sir Your explanation was awesome..for practice please upload code

  • @SanjeevKumar-nc4rx
    @SanjeevKumar-nc4rx 3 года назад +5

    @DeepLearning_by_PhDScholar Hello sir, I appreciate your work. Your explanation is great, but the issue we are getting is that we are getting some errors and somehow we solved it, but the main issue we are facing is that we are getting only closed eyes or only open eyes throughout the real-time test. So if you are reading this comment, please share the trained model with us because we don't have such a system to train 37000 images. Thank you Hope you will share the trained model soon once again thank you, sir.

    • @sashinkakumarage4739
      @sashinkakumarage4739 3 года назад

      I have the same issue. Did you find any solution to the issue?

    • @madihafarman5587
      @madihafarman5587 3 года назад

      i also have same issue..are you resolve

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад +1

      @@madihafarman5587 Hi, you can download the final model using the provided link,
      drive.google.com/file/d/1TpTjvjIVirEC_CA_pZSYVVv12XMFdM0l/view?usp=sharing
      However, as weights are always initialized randomly, so your final training model may differ from mine, Thank you for supporting the channel. Good luck.

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      @@sashinkakumarage4739 Hi, you can download the final model using the provided link,
      drive.google.com/file/d/1TpTjvjIVirEC_CA_pZSYVVv12XMFdM0l/view?usp=sharing
      However, as weights are always initialized randomly, so your final training model may differ from mine, Thank you for supporting the channel. Good luck.

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      Hi, you can download the final model using the provided link,
      drive.google.com/file/d/1TpTjvjIVirEC_CA_pZSYVVv12XMFdM0l/view?usp=sharing
      However, as weights are always initialized randomly, so your final training model may differ from mine, Thank you for supporting the channel. Good luck.

  • @CentroCoronelAprende
    @CentroCoronelAprende 2 года назад

    sir, I upload ur model new_model=tf.keras.models.load_model('my_model.h5') but all predictions say that my img is positive even if is closed eyes imagen. can you shared the correct model ?please?

  • @risaalkhan6928
    @risaalkhan6928 Год назад

    @DeepLearning_by_PhDScholar
    Sir plz can you tell me how do you seperate the closed eyes and open eyes folder it will be helpful sir

  • @crazystuff5854
    @crazystuff5854 2 года назад

    sir while doing this i had an issue regarding to the MobileNet() downloading process. It has thrown an error that 'String' object has no attribute 'decode'. What shall i do sir ??? Please help me sir .....

  • @aaaqaaaa2720
    @aaaqaaaa2720 2 года назад

    hello sir if i have a large datadet how to work in it in jupiter without download it in my computer

  • @krushnachandrasethi8776
    @krushnachandrasethi8776 2 года назад

    what if there is no light, i mean it's night or raining and it's dark around then how will you detect?

  • @akanksha_bhat9903
    @akanksha_bhat9903 3 года назад +1

    What to do in anaconda prompt.. after copying the path of the folder im not able to run the commands in anaconda prompt?? can you please explain

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      Thank you so much for your interest, it seems like you might not have run it as administrator. Secondly , once you copy the path, it must be in same drive as well. your question is too generalize, thats what I could predict based on your provided information. Please elaborate the exact problem , I hope we will try to solve your issue. please visit the first part of video and repeat the steps, I hope it will solve your issue, Stay blessed.

    • @rahulranjan923
      @rahulranjan923 3 года назад

      @@deeplearning_by_phdscholar6925 at least reply to our queries sir

  • @akshaymbhat9144
    @akshaymbhat9144 3 года назад +1

    Hello sir please tell me if I want to connect and run this project under cctv camera through opencv ?how can it be done? Please reply sir

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад +1

      Thank you for your interest in our videos,
      the tutorial is about usb based camera which could be any like webcam or CCTV. so as long as its usb based camera( CCTV) or webcam of your laptop, this code is valid.
      However, for "ip" based cameras , you need to use "socket programming " for which you have to define the ip: socket address for accessing your camera . once camera is accessed, rest of the code will be same.
      Summary , this code is valid for any usb based camera no matter, cctv, webcam, surveillance, webcam in your latptop. in case of ip based camera , you need to slightly modify first few lines for accessing the camera video.(e.g socket programming)
      I hope I have answered your questions, please keep supporting us like this and
      keep sharing our video if possible.

    • @akshaymbhat9144
      @akshaymbhat9144 3 года назад

      @@deeplearning_by_phdscholar6925 where can I change or add my ip address for cctv in this code and also about for webcam how can I add in this code. I implemented it and working fine for my laptop camera I want to implement in cctv as well as webcam simultaneously

    • @akshaymbhat9144
      @akshaymbhat9144 3 года назад

      Can you share me your what's app number or telegram so that I can share my implementation codes and thoughts over there please

    • @Rishita_Naik
      @Rishita_Naik 2 года назад

      @@akshaymbhat9144 can you please help me in implementing this code?

  • @thelerner
    @thelerner 3 года назад +1

    Can you please help how we use this as a driver drowsiness detection and what are the hardware requirements.

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад +1

      Thank you so much for your interest. Well this implementation is based on a simple PC. however, code is dynamic, if you want to deploy it for driver in dash board or anywhere, you should use an embedded system. this code is valid for jetson nano and raspberry pi 3b or any other hardware as long as it supports python and opencv.
      Follow the instructions, after training the model in computer , later for live webcame demo part, please copy code and model in raspberry pi or jetson nano or any other hardware which supports the specs mentioned in video.
      Keep supporting us like this , Stay blessed.

    • @thelerner
      @thelerner 3 года назад

      @@deeplearning_by_phdscholar6925 thanks

  • @Ali_ade
    @Ali_ade 2 года назад

    sir how can i use this project for pi camera

  • @umerakhtar2774
    @umerakhtar2774 3 года назад

    @DeepLearning_by_PhDScholar how we detect drowsiness using body movement ??

  • @euphoricverse3914
    @euphoricverse3914 2 года назад +1

    Sur can you provide the drive link of this file my_model_Drowsiness.h5
    The file you are sharing is my_model.h5
    Thank you!

  • @robinsonbill4382
    @robinsonbill4382 2 года назад +2

    Can you kindly send me the source code?

  • @birdyellow4330
    @birdyellow4330 3 года назад

    its great!!

  • @josephahn2624
    @josephahn2624 3 года назад +1

    good!
    why don't you use pytorch~?

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад +1

      Thanks for your valuable feedback, I will definitely come up with PyTorch implementation next time. Please keep supporting me like this

    • @josephahn2624
      @josephahn2624 3 года назад

      @@deeplearning_by_phdscholar6925 okay, i see.
      Anyway how's your life in the lab?

  • @janithprabhanuka
    @janithprabhanuka 3 года назад +1

    Super

  • @CHINMAYEEPSICS
    @CHINMAYEEPSICS 3 года назад

    Can u please tell the complexity of this project?

  • @failurefocues000
    @failurefocues000 Год назад

    how can i get this code sir?

  • @FZero320
    @FZero320 2 года назад +1

    Hi sir, could you please share the My_Model_Drowsiness.h5 file please. The drive file that you are sharing is the my_model.h5 file. Thanks

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  2 года назад

      Hi, below is the link to the model,
      drive.google.com/file/d/1TpTjvjIVirEC_CA_pZSYVVv12XMFdM0l/view?usp=sharing

    • @Rishita_Naik
      @Rishita_Naik 2 года назад

      Can you please share the code

    • @eladon19153
      @eladon19153 2 года назад

      @@deeplearning_by_phdscholar6925 The model gives me always positive value

    • @risaalkhan6928
      @risaalkhan6928 Год назад

      ​@@deeplearning_by_phdscholar6925 sir it is still not working

  • @hyndavithouti3350
    @hyndavithouti3350 3 года назад

    can anyone say how many layers did we use in this model?

  • @ishitamasale738
    @ishitamasale738 2 года назад

    Where can i run this code???

  • @Faris_eisa
    @Faris_eisa 2 года назад

    please, can you make the letters size smaller than that !!?

  • @sarahali2707
    @sarahali2707 3 года назад

    Hi sir,where can i get the source code?

  • @sheikhrahim719
    @sheikhrahim719 2 года назад

    Can u share the jupyter notebook

  • @dilrosereji4930
    @dilrosereji4930 3 года назад

    great!

  • @angel-pf7ny
    @angel-pf7ny 2 года назад

    Why camera is not opening in my pc i have done correct coding no error

  • @virajkudav3563
    @virajkudav3563 2 года назад

    How to train for yawn sir

  • @maf4432
    @maf4432 2 года назад

    Do you have the data set

  • @Prasanth4355
    @Prasanth4355 3 года назад

    ValueError Traceback (most recent call last)
    in
    35
    36 Predictions = new_model.predict(final_image)
    ---> 37 if Predictions>0:
    38 status="Open Eyes"
    39 else:
    ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

  • @nainasethi5841
    @nainasethi5841 2 года назад

    Anyone able to get the correct model? I am not getting -ve values as output in closed eye case, please help, very urgent

    • @ENGCS_Ananthasharmayn
      @ENGCS_Ananthasharmayn 2 года назад

      same here
      everything is correct but still, it's not showing -ve values
      have you fixed it?

  • @ppmppm3001
    @ppmppm3001 2 года назад

    can i do project in colab?

  • @garimachauhan5771
    @garimachauhan5771 Год назад

    Its showing open eyes for all images.Can anybody please help me

  • @sayyedaftabas4296
    @sayyedaftabas4296 2 года назад

    Sir it's showing me backtorgb is not defined ??

  • @seherkzl6635
    @seherkzl6635 3 года назад

    I trained my model for 10, 40, 200 epochs but I didn't have any negative values. I saw 'active' on screen but I didn't see anything when I closed my eyes. Please help me. I'm trying for my thesis.

  • @divyangisharma1412
    @divyangisharma1412 3 года назад

    Hello sir, I went through the entire code, its running, but I guess the code is getting too heavy, as its not responding coming while capturing :')
    Can you provide me with a solution for that.
    Please?

    • @Rishita_Naik
      @Rishita_Naik 2 года назад

      Can you please share the code link

  • @ridhimachopra7215
    @ridhimachopra7215 3 года назад

    Can u please please send the source code for ur wonderful project? I would definitely love to try it out.

  • @tamilkalam5519
    @tamilkalam5519 Год назад

    Brother I need source code ? please send me

  • @SakshamAggarwal
    @SakshamAggarwal 3 года назад

    Sir Will you please provide a code

  • @beeramsaimohan9086
    @beeramsaimohan9086 2 года назад

    Sir please share the code

  • @rishithm7255
    @rishithm7255 7 месяцев назад

    Code file plz.....

  • @madihafarman5587
    @madihafarman5587 3 года назад

    not detect close eyes.after completion of project

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад

      Hi, you can download the final model using the provided link,
      drive.google.com/file/d/1TpTjvjIVirEC_CA_pZSYVVv12XMFdM0l/view?usp=sharing
      However, as weights are always initialized randomly, so your final training model may differ from mine, Thank you for supporting the channel. Good luck.

    • @Rishita_Naik
      @Rishita_Naik 2 года назад

      Can you please share the link of code

  • @mouhihamohamed4789
    @mouhihamohamed4789 2 года назад

    ppt please

  • @sayyedaftabas4296
    @sayyedaftabas4296 2 года назад +1

    Can you please provide My_Model_Drowsiness.H5 file

  • @farhatakhtar6901
    @farhatakhtar6901 Год назад

    it not predict right. In closed eyes it give positive result.

  • @t0m3k1987
    @t0m3k1987 3 года назад

    Amazing work Sir! But I have some troubles with normalization process. When I do it on whole dataset i got memoryError. It cannot allocate 95gb. Can you help with this?

    • @barbugeorge1470
      @barbugeorge1470 3 года назад

      delete some photos from closed eyes/open eyes folders...I had the same problem

    • @varungupta7226
      @varungupta7226 3 года назад

      @@barbugeorge1470 Were you able to complete this project? I trained my model but its not returning negative values for closed eyes. Can you share your model file? it would be a huge help.

    • @avinashgedam5794
      @avinashgedam5794 3 года назад

      Did you solve your problem?

    • @t0m3k1987
      @t0m3k1987 3 года назад

      @@avinashgedam5794 yes. I used Google Cloud Platform to train model and it worled smoothly 😁

    • @avinashgedam5794
      @avinashgedam5794 3 года назад

      Why was it not showing negative values previously?

  • @dummytest3199
    @dummytest3199 3 года назад

    Hi, great video!
    Can you provide the source code for the project?
    Thanks. :)

    • @deeplearning_by_phdscholar6925
      @deeplearning_by_phdscholar6925  3 года назад +4

      Thank you for your interest. In case you follow the complete video, you will have the source code at the end, we did not share the source code for this video on purpose so that once can learn each line without directly executing the code. Thanks

    • @deltastorm7071
      @deltastorm7071 3 года назад

      @@deeplearning_by_phdscholar6925 Hey sir, I have watched the entire video and I'm now finding it really hectic to type the entire project, could you please link the source code?

    • @architraghuvanshi8892
      @architraghuvanshi8892 3 года назад +1

      @@deeplearning_by_phdscholar6925 Sir, we at least need the my_model_drowsiness.h5 as our laptop is not capable enough to train on various epochs.

    • @risaalkhan6928
      @risaalkhan6928 Год назад

      @DeepLearning_by_PhDScholar
      Sir plz can you tell me how do you seperate the closed eyes and open eyes folder it will be helpful sir

  • @rajganatra98
    @rajganatra98 3 года назад

    How to create 'my_model_drowsiness.h5'??

  • @dhananjaykumar-gc8ke
    @dhananjaykumar-gc8ke 9 месяцев назад

    Is there anyone whose code worked perfectly??

    • @MeetChaudhary-zi8sm
      @MeetChaudhary-zi8sm 9 месяцев назад

      If you got code please let me know i am also looking for same code

    • @praneethkumar3111
      @praneethkumar3111 7 месяцев назад

      even me , please share the code bro

  • @praneethkumar3111
    @praneethkumar3111 7 месяцев назад

    @DeepLearning_by_PhDScholar Thank you for your suggestion. We are finding it hard to create folders of open_eyes and Closed_eyes because main dateset contains both of them in each folder. Is it possible for you to share just the open_eyes and closed_eyes dataset.

  • @praneethkumar3111
    @praneethkumar3111 7 месяцев назад

    Hey sir, I have watched the entire video and I'm now finding it really hectic to type the entire project, could you please link the source code?