A face mask detection is a system capable of detecting if one or more individuals is/ are wearing their face mask. This project displays the number of faces detected, the number of peaople wearing the face mask correctly, incorrectly or not in a picture.
With the increasing number of COVID-19 victims, integrating systems capable of detecting people wearing a face mask properly or not will help us track them easily. I please everyone to wear their face mask correctly to reduce the risk of contaminating one another.
This system is a mask detection project that detects face mask on people'face. This flask web app detects if someone is wearing a face mask correctly, incorrectly or not.
This system retrieves an image uploaded extract the faces detected in the image, feed each face into a serialized model mask_detector.h5
which outputs a tuple composed of 3 values. The first value indicates the probability of no mask, the second value is the probability of a correct mask and the last one is the probability of the incorrect mask.
In the output picture, ach face is bordered by the color indicating his situation (No mask, Correct, Incorrect).
This website is built from scratch with HTML and CSS deployed to Flask use yourlaptop to test.
DATA COLLECTION: To Download the dataset check this repository
The system depends on the following files.
app.py
See here: The flask appfaceMask_model.py
See here: This file is the model used to build this projectmasks_detector.py
See here: This file is capable of detecting face mask in a live real-time video.mask_detector_image.py
See here :This python file detects face mask from an image uploaded from the systemmask_detector_video.py
See here:This python file detects face mask from an video uploaded from the systemhaarcascade_frontalface_default.xml
See here :The haar cascade classifier used for face detection.model_detector.h5
see here: this file is a serialized pickle file which accpets an image or a video and output a tuple of probabilities determining if the face detected in the inputted file has a face mask wore properly or not.multi-face mask5B.ipynb
See here :this file is the model used to build this project check it.
All the dependencies and required libraries are included in the file requirements.txt See here
Clone the repo
$ git clone https://github.com/memudualimatou/FACE-MASK-DETECTION-WEB-APP-FLASK-PYTHON.git
Change your directory to the cloned repo and create a Python virtual environment named 'test'
$ mkvirtualenv test
Now, run the following command in your Terminal/Command Prompt to install the libraries required
$ pip3 install -r requirements.txt
To download the mask_detector.h5 (The serialized model of this project) File click here, you can clone my bitbucket repository to download the file or run
faceMask_model.py
on your local environment to save it. This file is too large to be uploaded here.
Feel free to mail me for any doubts/query ✉️ [email protected]
Feel free to file a new issue with a respective title and description on the this mask detection repository. If you already found a solution to your problem, I would love to review your pull request!
Made with ❤️ by MEMUDU Alimatou Sadia Anike