Face Mask Detection using Python, Keras, OpenCV and MobileNet | Detect masks real-time video streams
Vložit
- čas přidán 9. 07. 2024
- In this Python programming video, we will learn building a Face Mask Detector using Keras, Tensorflow, MobileNet and OpenCV. We will also see how to apply this on a Live Video Camera. With further improvements these types of models could be integrated with CCTV cameras to detect and identify people without masks.
The face mask detector didn't use any morphed masked images dataset. The model is accurate, and since the MobileNetV2 architecture is used, it’s also computationally efficient and thus making it easier to deploy the model to embedded systems (Raspberry Pi, Google Coral, etc.).
This system can therefore be used in real-time applications which require face-mask detection for safety purposes due to the outbreak of Covid-19. This project can be integrated with embedded systems for application in airports, railway stations, offices, schools, and public places to ensure that public safety guidelines are followed.
Feel free to play around with the code, change the parameters and come ip with better accuracy. Let me know the changes in the comment section.
GitHub: github.com/balajisrinivas/Fac...
Numpy: • Complete Numpy A-Z | N...
Matplotlib: • Matplotlib Tutorial Pa...
Learn more about ImageDataGenerator: keras.io/api/preprocessing/im...
LinkedIn: LinkedIn: / balaji2512
Stay tuned for more such videos and subscribe to the channel
#python #FaceMaskDetection #keras #tensorflow #opencv
Introduction and Demo: (0:00)
Install Dependancies: (1:18)
Dataset: (2:10)
Data Preprocessing: (2:58)
Training: (9:03)
Run and View Accuracy: (17:09)
Use model in real time Camera: (18:20)
Final Result: (25:30)
Amazing tutorial. You're underrated bro.
This is the First video ...
And you got my subscription 😍
Perfect explanation
Amazinggg!! Perfect speed, understandable thank you so much for this video!!
In my opinion, I think that you are the best Indian who makes tutorial like this. Very very very easy to follow and you learn so much! Thanks! ❤
Bro.... You are great at what you do. Good Job!!!
Thanks a lot for this. Easily understandable explanation and codes.
This is really very very useful video sir. Thank you so much to explain in such good way and giving amazing explanation. Once again thank you sir.
If I were to run this on raspberry pi, will I have to convert both the mask_detecting model AND the face recognition model to tflite? Or just the tf lite?
Hi balaji, I'm in the beginning of Deep Learning concepts right now. Thanks for this video, this really keeps me motivated. After finishing those concepts I'll come back to this project.
You finish ?
Bro did you have this project report
@@mohamedsamsudeen208 I too need
Have u done paper bro
you save my life from my class project Thank you bro!!!
Wonderful. This cleared a lot of doubts I had. Thank you sir
This project saved my life at the last moment of my codeathon
Thank you very much Sir
It helped a lot
hii. will u help me in this project. am getting tensorflow errors. this weekened i need to submit the project. am getting fear , till now i didnt rectified the errors. please help me
U completed this project??
@@geethanjaligajulapalli3189 ok
@@h.o.p.e3071 yea
do u have documentation for this project?
bro if you dont mind can you please explain what's going on in the detect_and_predict_mask function in the execution program.
Here's a paid course for this: It's amazing
khadymschool.thinkific.com/courses/data-science-hands-on-covid-19-face-mask-detection-cnn-open-cv
Easily understandable 👌 Thank you man
Amazing youtube channel for python projects
Hey, actually that was a easy and simple as you explain .
I'm really interested to see your other videos as well. If I have any quires i ll reach you either through mail or any other social media .
I plan to start my learning completely with your videos 😂.
I'm currently working as a python developer .
Have you done paper bro
How to add the path in anaconda prompt?
@@akshatsrivastava7771 is it compulsory to add path for using tensorflow??
Is there a way where you can add a third dataset, to have a option of "bad mask"?
Where they have the mask on wrong, with the nose out?
Simple collect images where nose is out
And create a third folder and adjust the changes in code aswell
@@goldmanhadad I actually trying this,it's not accepting more than 2 datasets,can u please tell where should i modify code??
@@lakshmipriyaanumula9506you can probably google the multiple class classification sample coding for CNN, I think there are many samples out there.
Could anyone tell whether this project is based on neural networks??
@@subrinas7830 yes its cnn model
Thank you so much. I've done this for my semester project and it is working perfectly.:)
Bro this project is based on which algorithm
very helpful brother you saved me from deadline of project submission
What algorithms are used in the project?
yes.... if anyone knows please said now
It was really helpful, can you give any suggestions for detecting mask from a long distance.
This model supports approx 2 meters.
Can probably change the Face Detection Model to improve detection distance. YOLO's pre-trained face models should work fine for the same.
you could try training different images to detect mask wearing from a long distance
Have you done ppt bro
Really a very good demonstration of the code for mask face detection
Thank u sir very very much aaj apke wajah se bina project kiye hi marks mil jaeyga..thank u
@Balaji, very nice video! Very helpful narration. Thank you. I'm a newbie in this area and plan tp watch your other videos. In general, how do you decide which specific model to use for a certain application/use case? TensorFlow itself has so many different 'families' of options (MobileNet, Inception, ResNet, Hourglass just to name a few - let alone the dozens of feature_extractors in each family). Then there are other classifications such as RCNN, SSD, Center_Net, etc.). Too confusing choices for new learners. Would you please make a separate video just comparing them all?
Separately and completely unrelated, would you please create similar video on Predictive Maintenance of capital assets (i.e. machinery and equipment) directly applicable to the manufacturing industry, where the manufacturer wants to know when to send in maintenance service personnel to the client site for maintenance/repair/part replacement based on the telemetry (sensor) data. Two typical questions are: (1) What's the RUL (Remaining Useful Life) of the machine or one of its components, and (2) Will the machine or a specific component fail in the next 24 hours/week/month/quarter/year (whichever time horizon is most appropriate for that machinery and its operating demands).
On which ide is he coding ???
@@nksg2756 same doubt bro
@@kathir6581 sublime text
Amazing work Balaji can i know what is the training and validation accuracy you have achieved???
Have provided dataset path ?
czcams.com/video/Wabv083v9c4/video.html
Watch potrait by coding in python
go to school for 99.999999%
How to add the path in anaconda prompt?
The idea is very good and I liked it. I hope you keep doing these kind of things!
lot of subject ,much better than many youtube videos
Hello, your code is amazing. However I also want to detect wearing face masks incorrectly, what should I do ?
ERROR: Could not find a version that satisfies the requirement tensorflow>=1.15.2 (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for tensorflow>=1.15.2 (from -r requirements.txt (line 1))
install python and opencv first then try
@@abdullah_khan6887brother I got the same problem... Can you please elaborate how can I fix this issue
Thank you so much. Keep posting the videos because that help us to learn things in best way.
Thanku so much sir.. Wonderful project. All things worked in 3hours
amazing , can you tell me what is the version of tensorflow that you use it?
It was really helpful, can u make a tutorial on face recognition using one shot learning??
Sure, will do it!
@@BalajiSrinivasan25 Thank u sir, It will be really helpful as there's no video on practical one shot learning and triplet loss in practice for face recognition...
@@cricketlovers3286 keras is part of tensorflow.
@@BalajiSrinivasan25 sir can you create a code for live face mask
Here's a paid course for this: It's amazing
khadymschool.thinkific.com/courses/data-science-hands-on-covid-19-face-mask-detection-cnn-open-cv
hello sir, can u mention your PC specs. in detail for ram, cpu and gpu etc. and please tell us in next video that how to use GPU while training model
from tensorflow
can u recognise the face if i send u a video ,
@@WanuXbro I got same issue of tensorflow... How can I resolve it
bro thanks a lot. i applied your code logic to detect if the eyes are close or not and it works!
its really helpful , extremely thanks bro you did a great job
wonderful project appreciate if trigger an email when ever a person appears in camera with out mask. is it possible??
Yep it is possible with basic if else. If the person is not wearing a mask, send a mail. U can refer youtube to see how to send a mail.
What algorithm is used in this project can u tell???plz
Yes it's possible bro
Hi! Great job! Why it could detect face only when it's close to the camera? Am I able to get detection when I'm 4-5 meters far?
Depends on dataset and clarity
Lovely explanation. Helped a lot. Thank You
Thank you so much anna .Really very useful for me such a great video.I got the output correctly.
Great job, nice thank you. I would like to know more files inside face_detector folder: deploy.prototxt and res10_300x300_ssd_iter_140000.caffemodel how you construct them
Same here
Downloaded from elsewhere,preexists
@@NithishKumar-se9ev how did u open the file?
caffee model is pre-trained deep learning model for face detection made with caffee frameworks like Tensorflow and PyTorch. You can create caffeemodel with that or you can also create with tensorflow.
@@binayakpanda5749 it's on his github link in the desc
WHAT IF SOMEONE HAS BIG BEARDS .??WILL IT BE DETECTED AS MASK??
need to add that kind of images while training..
No it didn't
Best tutorial
💯Working
Thankyou sir
Good job with simple implementation
Some files are like ERROR: Could not find a version that satisfies the requirement opencv-python==4.2.0.*
ERROR: No matching distribution found for opencv-python==4.2.0.*
ERROR: No matching distribution found for numpy==1.18.2 my error is this can any one help please
Hi i am facing similar error where you able to fix this issue please help if u can
Hi Balaji!
I tried to execute the source code. But getting some errors. Could you please help?
make sure that you have created a new environment in anaconda and then install the packages given in the video in that environment. You can find tutorials on youtube on how to create envrironment using anaconda prompt
Very nice video and simply explained... Many thanks..
i learnt much more after watching this video
Simple doubt, WILL IT SHOW IF WE ARE WEARING A TRANSPARENT MASK !!!! 😐🔥
After few modifications in code and images used
Glue piece of cloth over mask
when i tried, it is showing that failed to load native tensorflow runtime. what to do now? can you please help me
Yes exactly
This is great work.
Thankyou sir, your explanation so easy to understand, the code flow also looks clear
Traceback (most recent call last):
File "c:\Users\user\Documents\object detect\Face-Mask-Detection\train.py", line 38, in
path=os.path.join(DR, CATEGORIES)
File "C:\Users\user\anaconda3\envs\tensorflow_env\lib
tpath.py", line 117, in join
genericpath._check_arg_types('join', path, *paths)
File "C:\Users\user\anaconda3\envs\tensorflow_env\lib\genericpath.py", line 152, in _check_arg_types
raise TypeError(f'{funcname}() argument must be str, bytes, or '
TypeError: join() argument must be str, bytes, or os.PathLike object, not 'list'
getting this error
Can i use your project as my college project?
Yes
Bro if u had make project report can u pls share?
Could I get the documentation on this project
Have you done paper
@@saisharaneruventi2180 yes
It's urgent
@@saisharaneruventi2180 sure, will mail u....kindly send ur id
@@sushmithareddy7564 can u send ..it's urgent
Thank you So much! Great tutorial :)
amazing tutorial ... to make it more acurate i ncreased the dataset
And here I am not able to write hello world program😂
RIP bro☺
hmm
Really Nice explanation 👌 Thank you 😊
Amazing Video. Very well designed and explained in detail step by step.
Great video, explanation and code!
Thank you so much!
what ide is he using?
Explained it very well..👌👍👏
thanks balaji! this helps me a lot!
Thank you sir 🔥
Crystal clear explanation 💥
Thank you.
@@BalajiSrinivasan25 sir can u tell what algorithm is used ??plz👍🏻
Great learning experience with you
The great work sir,
Make it more videos.
thanks a lot for making a super amazing video........its very useful
Thank u very much. So amazing!
I have subscrived to your channel wonderful explanation.................................to all topics...... please upload more video in deep learning image classification object detection in image and video behaviour detection..................Good Video Sir....................
Tq so much it helped a lot to my major project
Really amazing explanation.
Thank you so much Sir this video helped me a lot
Thankyou, Very helpful!
Amazing work bro !!!...me becoming follower
man youre saviour thank u bro
Just Awesome brother.
Superb anna.. romba helpful ah irunthichu 😍
Thank you so much bro for your idea to share with us..
Worked for me ..Thank you
Great Job!! learnt quite a lot from this video, and will play around with the code for sure
can u pls tell me what is (1,1,200,7) showing on cmd after running detect_mask_video file in the last?
finally i got success for making Mask Detection
Thanks a lot Sir
Hi can u share me documentation for face mask detection
hi can u share me the code and dataset? very appreciate it
Hi Balaji Thanks, just wanted to get your feedback I want to run this facemask use case on Intel servers using Linux OS with IP Camera can you give your feedback on this how can I proceed with this setup
the video is very informative thank you
Great video ....thanks🙏🙏
Very helpful ☺️👍... Keep going
Thank u so much for help. Past few days i was having many errors. And now after seeing this. All my doubts are cleared❤❤
Bro have you done any report or ppt ??
thank you for your video!
Hope you have a nice day sir !
Best explanation..Thank you🙏🏻🙏🏻
Super amazing project bro
Thank you so much for your sharing. This is very helpful.
Thank you so much bro 👍🏻 keep going 🌻🌻🌻🌻🌻🌻🌻🪐🪐🪐🪐🪐great job 😊
What can I use instead of labelbinarizer for categorical values? If I use labelencoder do I need to use like that? I mean do I need to write just lableencoder instead of labelbinarizer?
Worked👍..
Thanks..
superb work
CZcams never rewards valuable content
Thank you so much sir 🙏
Thank you very much sir
Sorry i want to ask something about the dataset. From your video, you saved the dataset in your local dir and called in the code. For my case, can i use a cloud service such as AWS, Firebase, etc for storing the dataset? If possible can you show me how?
Very nice explanation! Did you resize all the images used? If I want to add more images to the dataset do I need to resize or pre process them?
Bro can you tell me algo used in this to detect the mask and face without mask......?
@@rishiAura Adam optimization algorithm
Try to install pakage for tensorflow>=1.15.2 but got error no version satisfy please suggest
great job man
hats off to you brother