Face Mask Detection using Convolutional Neural Networks – Python | Keras | Tensorflow | OpenCV
[ad_1]
This tutorial explains a method of building a Face Mask Detector using Convolutional Neural Networks (CNN) Python, Keras, Tensorflow and OpenCV. With further improvements these types of models could be integrated with CCTV or other types cameras to detect and identify people without masks. With the prevailing worldwide situation due to COVID-19 pandemic, these types of systems would be very supportive for many kind of institutions around the world. Please let me know your ideas, suggestions and concerns in the comment section and feel free to improve this project yourself and come up with better results.
Download the code (Github): https://github.com/aieml/face-mask-detection-keras
Download the code and Materials (Google Drive): https://drive.google.com/open?id=1e2-Ms1e9ar79MMl7gtEzQ8fXKad5yFP0
Speaker: Thakshila Dasun
Source
[ad_2]
I am running these model but 3.0 detecting mask is not running. They are showing these errors OpenCV(4.4.0) C:UsersappveyorAppDataLocalTemp1pip-req-build-2b5g8ysbopencvmodulesimgprocsrccolor.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
Please provide me solutions.
Thanks
please Sir can you help me on an error that my compilator show me?
code : history = model.fit(train_data, train_target, epochs=20, callbacks=[checkpoint], validation_split=0.2)
Error : ValueError: Shapes (None, 1) and (None, 3) are incompatible
I use three category on my dataset ('with_mask', ' without_mask' and 'mask_weared_incorrect')
How can I get an alarm when there's no mask triggered?
Can I get your mail Id? I need your help for my project work.
I tried installing keras but it shows module not found, could you please explain
i am using google colab, but facing the problem in
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
following error msg——–
OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
How can we do image augmentation
if we cover the face with hands what it will show mask or no mask??
the source code at below error
checkpoint = ModelCheckpoint('model-{epoch:03d}.model', monitor='val_loss', verbose=0, save_best_only=True, mode='auto')
history = model.fit(train_data, train_target, epochs=30, callbacks=[checkpoint], validation_split=0.2 )
message error " AttributeError: 'ModelCheckpoint' object has no attribute '_implements_train_batch_hooks'"
how to fix it?
please help me..
the source code at below error
How did you save the cnn model in your local machine?
Can I do these with pictures I have or just with yours?
Thank you for your best explanation,,it is very very useful for me and it's 100%working.thank you once again …🙏🏻🙏🏻
Cab i get dfd 0,1 and 2
Can we use pre trained networks for this?
Hello can u provide me the complete documentation report of the project so that I can step ahead to work upon it …..
FileNotFoundError Traceback (most recent call last)
<ipython-input-22-c18bdec1206f> in <module>()
1 data=np.load('images.npy')
—-> 2 new_target=np.load('labels.npy')
/usr/local/lib/python3.6/dist-packages/numpy/lib/npyio.py in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
426 own_fid = False
427 else:
–> 428 fid = open(os_fspath(file), "rb")
429 own_fid = True
430
FileNotFoundError: [Errno 2] No such file or directory: 'labels.npy'
what is error ???
Hey guys whoever is facing the accuracy issue just change the pixels to 224 and then accuracy and val accuracy boosts up to 90 percent
Technological chains for the human cattle?
i have used the same CNN model mentioned in your video. But my best accuracy is just 50%. Can you help on how to increase the acccuracy?
im getting this error
ValueError: zero-size array to reduction operation maximum which has no identity site:stackoverflow.com in line15
please help me how to solve this problem ?
@AI with Thakshila
Thanks for the video, sir!!It greatly helped a beginner like me understand things veryyy clearly.
I am getting an error in the line:
gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
The error is:
error: OpenCV(4.1.2) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'
Until here,everything works perfectly fine except that only 31 images were taken instead of 990 images.
Can you please help me fix this?Please,sir…
Sir, your work is a really appreciable one….keep going.
Sir im getting this error while running the third file-detecting facemask :
OSError: SavedModel file does not exist at: model-017.model/{saved_model.pbtxt|saved_model.pb}
while running this:
model = load_model('model-017.model')
face_clsfr=cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
source=cv2.VideoCapture(2)
labels_dict={0:'MASK',1:'NO MASK'}
color_dict={0:(0,255,0),1:(0,0,255)}
please help me resolve this sir
could speak a little bit clear
Can we detect 4 or 5 faces at the same time using this code??
hi am an problem in keras "jupyter notebook's kernel keeps dying" can you help me?
module 'keras.optimizers' has no attribute 'TFOptimizer' it is giving this error >> how do i remove it please help
after doing everything the camera is not opening ,the camera will be running but it wont open and show live as u shown above
Sir please send ur mail ID.
Hi Thakshila,
I am getting an error at line model=Sequential(),
the error is InvalidArgumentError,
would you please help me resolve it.
How can we collaborate that setup with social distancing monitoring? Can u help please. Contact me 9453955033 what's app no.
The program doesn't show mask when you have mask on. I think there's a problem with the dataset or the loop.
Sir is it possible to these techniqye using deep learning
Can you please make a video on face recognition attendance system using cnn?
SIr I am geeting this error when i want to open my webcam
error: OpenCV(4.4.0) C:UsersappveyorAppDataLocalTemp1pip-req-build-k8sx3e60opencvmodulesimgprocsrccolor.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
can we apply the alarm or alert msg
This video was random to me
Now I'm subscribed thinking that i get practical knowledge on ML
Does this produce a trigger if a person is not wearing a face mask?
why did you convert it into 4d array in the beginning ???
it will work in python 3.7 or not??
Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation.
please help me.
Great video sir 😍😍😍😍
Can I do this as my final year project? Please reply
can you please explain that how did you write the code in color_dict at 13:30 in video? please sir……!!! and sir have you write this complete code by yourself?
i do not use the file haarcase_face.xml in project is it okey?
Facing bellow issue please help me on , Thanks
—————————————————————————
error Traceback (most recent call last)
<ipython-input-6-40ade21b3ea4> in <module>
14
15 ret,img=source.read()
—> 16 gray=cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
17 faces=face_clsfr.detectMultiScale(gray,1.3,5)
18
error: OpenCV(4.4.0) C:UsersappveyorAppDataLocalTemp1pip-req-build-j8nxabm_opencvmodulesimgprocsrccolor.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
While training the model, it is only considering 31 images instead of 990. Can you suggest me something how can I proceed?
While debugging the all data is loading perfectly and it is also getting divided correctly into train data and test data. Does anyone also faced the same issue?