Face Mask Detection using OpenCV, Keras/TF and Deep Learning | Detect Masks in Real-Time videos

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 93

  • @XAustinSky
    @XAustinSky Před 3 lety +2

    I'd like to thank you for making this video as it is a very helpful reference for my research!

  • @AI__Alpesh_Gaykar
    @AI__Alpesh_Gaykar Před 2 lety +1

    is detect some errors like Imutils module are not found what can i do here

  • @empowercode
    @empowercode Před 3 lety +3

    Hey Satyajit, nice to meet you! I just found your channel and subscribed, love what you're doing!
    I like how clear and detailed your explanations are as well as the depth of knowledge you have surrounding the topic! Since I run a tech education channel as well, I love to see fellow Content Creators sharing, educating, and inspiring a large global audience. I wish you the best of luck on your CZcams Journey, can't wait to see you succeed! Your content really stands out and you've put so much thought into your videos!
    Cheers, happy holidays, and keep up the great work!

  • @amjayshri
    @amjayshri Před rokem +1

    Nice work sir!

  • @ahmetcankarakus6326
    @ahmetcankarakus6326 Před 3 lety +1

    How many times your model learned?
    I mean what is your epoch number on this project?
    Thank you

  • @tranthiphuongthao8342
    @tranthiphuongthao8342 Před 2 lety

    Hello everyone
    I am working on a project on this topic
    Not sure if the model you are making is the same as the model used in this video tutorial?
    I'm not sure if this videos is using MobileNet SSD V2 or MobileNetV2?
    Thank you.

  • @shashinthadanuka5395
    @shashinthadanuka5395 Před 3 lety +1

    Bro i want to send data to arduino accoding to the result of this face mask detection. How can i edit this code. Plz help

  • @t561355
    @t561355 Před 2 lety +1

    Thank you! That's great and useful work! And very interesting video!

  • @JainmiahSk
    @JainmiahSk Před 3 lety +1

    Computer Vision is Very Interesting Topic.

  • @ujalamaurya292
    @ujalamaurya292 Před 2 lety +2

    what accuracy you got for the model?

  • @annisajaniarh6989
    @annisajaniarh6989 Před 3 lety +1

    Hi Satyajit Pattnaik, nice to see what u doing right now!
    i wanna ask you about the source at deteck_mask_video. what is prototxtPath = r"face_detector\deploy.prototxt"
    weightsPath = r"face_detector
    es10_300x300_ssd_iter_140000.caffemodel"
    where i get path prototxtPath and weightsPath ?

  • @niteshtudu6449
    @niteshtudu6449 Před 2 lety +1

    Sir ...what are the 4 coordinates while running the program?

  • @041_saisaranta5
    @041_saisaranta5 Před 2 lety +2

    Sir can you pls say the questions that can be asked regarding this project for the interview?? i have got TCS interview tomorrow. pls help me

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 2 lety +1

      They would be asking your strategy for solving this problem, what all techniques are used, and they might deep dive into, object detection, CNN models, what are filters, how to define filters, input_size vs target_size, iterations vs epochs, back propagation etc etc.

    • @041_saisaranta5
      @041_saisaranta5 Před 2 lety

      @@SatyajitPattnaik thanks a lott sir

    • @041_saisaranta5
      @041_saisaranta5 Před 2 lety

      @@SatyajitPattnaik sir what algorithm we used here sir??

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 2 lety +1

      @@041_saisaranta5 have you gone through the video carefully?
      If yes, you should know what was used.

    • @041_saisaranta5
      @041_saisaranta5 Před 2 lety

      @@SatyajitPattnaik sir u have mentioned face detection algorithm. May i know which type of face detection algorithm is been used here sir??btw thank you for your all the clarification sir huge thanks sir

  • @abinpmathew8126
    @abinpmathew8126 Před 2 lety

    Hi Sir. I have a doubt. Is Haar Cascade algorithm used in face recognition?

  • @adindaramadani9239
    @adindaramadani9239 Před 2 lety

    hello sir, I have a question, it will be the same if the project we run in jupyter notebook?

  • @maalimaali9902
    @maalimaali9902 Před 3 lety +1

    How can I extend this AI system by adding a notification mechanism to report any face mask violation to authority?

  • @muhammedanask8556
    @muhammedanask8556 Před 3 lety +1

    Thanks bro❤❤ , its worked but the mask faces not detecting only detecting non mask faces, please reply

  • @charanteja4613
    @charanteja4613 Před 2 lety

    Here it is detecting only one face right how can it detect multiple images

  • @rekxspein
    @rekxspein Před 3 lety

    what If I want to take a frame of each person who doesn't wear mask??

  • @Bharghav861
    @Bharghav861 Před 3 lety +1

    At first thank you for making this project, brother now my question is,if i directly download the code from your github,and paste and run it in my Spyder console,will i get the output? I mean the video stream?

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      Yes, fork it.

    • @Bharghav861
      @Bharghav861 Před 3 lety +1

      @@SatyajitPattnaik because i was getting some errors from other sources and ML website codes,so u sure right i wont get any error?

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      @@Bharghav861 I did video on this code, so the code will definitely work, in case it doesn't work, it must be because of some minor library version mismatch issue which can easily be fixed.

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      just try the code and let me know if it fails.

    • @Bharghav861
      @Bharghav861 Před 3 lety

      @@SatyajitPattnaik bro im gettin an error like this "TypeError: Unexpected keyword argument passed to optimizer: name"

  • @kedaruttarwar9328
    @kedaruttarwar9328 Před 3 lety +1

    While i'm running the video stream model it giving cubals library error

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      Paste the error so that I can see.

    • @kedaruttarwar9328
      @kedaruttarwar9328 Před 3 lety

      @@SatyajitPattnaik E tensorflow/stream_executor/cuda/cuda_blas.cc:226] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
      W tensorflow/core/framework/op_kernel.cc:1767] OP_REQUIRES failed at conv_ops.cc:1287 : Not found: No algorithm worked!
      showing this type of error

  • @indriawanda
    @indriawanda Před 2 lety +1

    hi! is this using transfer learning?

  • @Kishore-zd9id
    @Kishore-zd9id Před 5 měsíci

    error
    File "C:\python\COVID-19 Face Mask Detector\Face-Mask-Detection-master\detect_mask_video.py", line 89, in
    maskNet = load_model("mask_detector.model")

    File "C:\Users\DELL\AppData\Roaming\Python\Python311\site-packages\keras\src\saving\saving_api.py", line 191, in load_model

  • @shaddyrogue9430
    @shaddyrogue9430 Před 3 lety +1

    What was the accuracy of this code?

  • @jaswantsuthar7793
    @jaswantsuthar7793 Před 2 lety

    how can we add beep sound there is no mask

  • @t561355
    @t561355 Před 2 lety

    Could you tell me how to improve the accuracy of face detection when it is far from the camera?

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 2 lety

      you need to add such images in the training data in order to have better accuracy

  • @roshithraj1215
    @roshithraj1215 Před 3 lety

    Bro,which is dfd for this project

  • @Mehedi.25
    @Mehedi.25 Před rokem +1

    via screen ta khub e choto,,,boro korar kono way ace?

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před rokem

      You can define the height & width like this:
      # Set the width and height of the window
      width = 800
      height = 600
      dim = (width, height)
      and just after you are capturing, pass the dim in the cv2.resize function
      # Capture the frame from the webcam
      ret, frame = cap.read()
      # Resize the frame
      resized = cv2.resize(frame, dim, interpolation=cv2.INTER_AREA)

  • @dangly2192
    @dangly2192 Před 3 lety +1

    Hello Sir,
    Can I train this with three data at the same time like with_mask, without_mask and incorrect_mask?
    Please help me, thanks you very much.

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      Ofcourse.

    • @dangly2192
      @dangly2192 Před 3 lety

      @@SatyajitPattnaik Can you help me, Sir? I have some problem when I train this with three data. Thanks you very much.

    • @dangly2192
      @dangly2192 Před 3 lety +1

      @@SatyajitPattnaik This is my error Sir:
      ValueError: Found array with dim 3. Estimator expected

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      @@dangly2192 Upload your code on GitHub and share link, let me see

    • @dangly2192
      @dangly2192 Před 3 lety +1

      @@SatyajitPattnaik
      github.com/hd999/facemaskdetection
      Thanks you very much, Sir.

  • @saisharaneruventi2180
    @saisharaneruventi2180 Před 3 lety

    Can I get paper or report for this

  • @akhileshrmadhyastha6400

    Can we have multiple faces with mask or without Mask does this project work for multiple people with masks?

  • @roshanprajapati1579
    @roshanprajapati1579 Před 3 lety

    Deploy. Prototxt and Caffè model do not found what to do?

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      If you have any specific error, it could be because of package version mismatch, pls google your errors and you will find the issue, else post it on Stackoverflow and send me the link, I will help you solve the error

    • @roshanprajapati1579
      @roshanprajapati1579 Před 3 lety

      @@SatyajitPattnaik I literally tried everything from stackoverflow and CZcams bt still stuck on this

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety +1

      @@roshanprajapati1579 so post your question, and send me the link, without looking at the code, nobody can help.

    • @roshanprajapati1579
      @roshanprajapati1579 Před 3 lety

      @@SatyajitPattnaik how do I send u I have my code on my system.. I want to send error photo to u and I have copied ur program from ur git hub its exactly same as of u

    • @roshanprajapati1579
      @roshanprajapati1579 Před 3 lety

      @@SatyajitPattnaikanswers.opencv.org/question/204774/cant-open-deployprototxttxt-in-function-cvdnnreadprotofromtextfile/

  • @kiranmanmode8056
    @kiranmanmode8056 Před 3 lety +1

    Which algorithm use???

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      Please watch the video, I have explained it.

    • @kiranmanmode8056
      @kiranmanmode8056 Před 3 lety

      @@SatyajitPattnaik face mask detection

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      @@kiranmanmode8056 Face mask detection is the use case, but we have used opencv, Keras and Tensorflow for this problem.

    • @kiranmanmode8056
      @kiranmanmode8056 Před 3 lety

      @@SatyajitPattnaik thank u...and which database use

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      @@kiranmanmode8056 The data is stored on local machine, we haven't used any database, I would request you to go through the video first before asking the basic doubts.

  • @subrinas9136
    @subrinas9136 Před 3 lety +1

    Is it based on CNN??

  • @anikettandle
    @anikettandle Před 2 lety

    can u SHARE PPT PLZ

  • @deepashreenaik4630
    @deepashreenaik4630 Před 3 lety

    How to install the libraries??

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      pip install in your anaconda prompt, or IDE console (You can google, and will find everything easily)

  • @rcyakc
    @rcyakc Před 3 lety

    Sir I need help with this issue. when i run the code for video stream. it just opens the webcam for a second and then it closes and this issue came.
    (base) D:\RC masters\face mask detection>python detection_video_mask.py
    2021-05-23 16:13:09.681806: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
    2021-05-23 16:13:09.682004: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
    2021-05-23 16:13:12.658155: I tensorflow/compiler/jit/xla_cpu_device.cc:41] Not creating XLA devices, tf_xla_enable_xla_devices not set
    2021-05-23 16:13:12.660041: W tensorflow/stream_executor/platform/default/dso_loader.cc:60] Could not load dynamic library 'nvcuda.dll'; dlerror: nvcuda.dll not found
    2021-05-23 16:13:12.660551: W tensorflow/stream_executor/cuda/cuda_driver.cc:326] failed call to cuInit: UNKNOWN ERROR (303)
    2021-05-23 16:13:12.666547: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:169] retrieving CUDA diagnostic information for host: DESKTOP-HTM5K3B
    2021-05-23 16:13:12.666856: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:176] hostname: DESKTOP-HTM5K3B
    2021-05-23 16:13:12.668073: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2
    To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
    2021-05-23 16:13:12.668936: I tensorflow/compiler/jit/xla_gpu_device.cc:99] Not creating XLA devices, tf_xla_enable_xla_devices not set
    [INFO] starting video stream...
    [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6sxsq0tp\opencv\modules\dnn\src\dnn.cpp (3444) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively OPENCV/DNN: [Convolution]:(conv1_1): getMemoryShapes() throws exception. inputs=1 outputs=0/1 blobs=0
    [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6sxsq0tp\opencv\modules\dnn\src\dnn.cpp (3447) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively input[0] = [ 1 3 224 224 ]
    [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6sxsq0tp\opencv\modules\dnn\src\dnn.cpp (3457) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively Exception message: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6sxsq0tp\opencv\modules\dnn\src\layers\convolution_layer.cpp:319: error: (-215:Assertion failed) blobs.size() != 0 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'
    Traceback (most recent call last):
    File "detection_video_mask.py", line 105, in
    (locs, preds) = detect_and_predict_mask(frame, faceNet, maskNet)
    File "detection_video_mask.py", line 28, in detect_and_predict_mask
    detections = faceNet.forward()
    cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-6sxsq0tp\opencv\modules\dnn\src\layers\convolution_layer.cpp:319: error: (-215:Assertion failed) blobs.size() != 0 in function 'cv::dnn::ConvolutionLayerImpl::getMemoryShapes'

  • @kedaruttarwar9328
    @kedaruttarwar9328 Před 3 lety

    E tensorflow/stream_executor/cuda/cuda_blas.cc:226] failed to create cublas handle: CUBLAS_STATUS_NOT_INITIALIZED
    W tensorflow/core/framework/op_kernel.cc:1767] OP_REQUIRES failed at conv_ops.cc:1287 : Not found: No algorithm worked!
    showing this type of error

    • @SatyajitPattnaik
      @SatyajitPattnaik  Před 3 lety

      Looks like an out of memory issue, what's your CPU configuration?

    • @kedaruttarwar9328
      @kedaruttarwar9328 Před 3 lety +1

      @@SatyajitPattnaik The problem is solved, I had downloaded wrong cuDNN lib. Version.