Your Raspberry Pi can detect if you are wearing a face mask or not.
How to Build a Face Mask Detector with Raspberry Pi : Read more
How to Build a Face Mask Detector with Raspberry Pi : Read more
The scheduled forum maintenance has now been completed. If you spot any issues, please report them here in this thread. Thank you!
Hi Andrew,When i run, I got error 🙁
[INFO] loading face detector model...
[INFO] loading face mask detector model...
Traceback (most recent call last):
File "detect_mask_webcam.py", line 98, in <module>
maskNet = load_model(args["model"])
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 166, in load_model_from_hdf5
model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
Hi Kart94Hi Andrew,
I too encountered the same error I found out its because of h5py version 3.0.0 , one of the solution I found on git was to remove .decode() from hdf5_format.py . I'll post the git link for your reference.
https://github.com/tensorflow/tensorflow/issues/44467
I got the same error pleas to help meWhen I am running the detect_mask_picam.py i am getting the following error
[INFO] loading face detector model...
[INFO] loading face mask detector model...
Traceback (most recent call last):
File "detect_mask_video.py", line 98, in <module>
maskNet = load_model(args["model"])
File "/home/pi/mask_project/mask-env/lib/python3.7/site-packages/tensorflow_core/python/keras/saving/save.py", line 149, in load_model
loader_impl.parse_saved_model(filepath)
File "/home/pi/mask_project/mask-env/lib/python3.7/site-packages/tensorflow_core/python/saved_model/loader_impl.py", line 83, in parse_saved_model
constants.SAVED_MODEL_FILENAME_PB))
OSError: SavedModel file does not exist at: mask_detector.model/{saved_model.pbtxt|saved_model.pb}
what to do please help
I also would be interested if anyone has done this? Any responses or help given?Hi. Thanks to you, I was able to make a good mask detection program. Thank you.
I want to add one more thing.
If you don't wear a mask, you'll sound a siren.
What additional code should I add if I want to play a video from a file that recommends wearing a mask?
When i run, I got error 🙁
[INFO] loading face detector model...
[INFO] loading face mask detector model...
Traceback (most recent call last):
File "detect_mask_webcam.py", line 98, in <module>
maskNet = load_model(args["model"])
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/save.py", line 146, in load_model
return hdf5_format.load_model_from_hdf5(filepath, custom_objects, compile)
File "/usr/local/lib/python3.7/dist-packages/tensorflow_core/python/keras/saving/hdf5_format.py", line 166, in load_model_from_hdf5
model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'
input_shape
is undefined or non-square, or rows
is not in [96, 128, 160, 192, 224]. Weights for input shape (224, 224) will be loaded as the default.input_shape
is undefined or non-square, '