Real time face mask detection using Python, OpenCV and Keras.
- This project is concerned with the detection of face masks.
- There are tree operation in this project:
- Detect face mask on images (using Keras/TensorFlow)
- Detect face mask on real time video stream and webcam
- Also, you can find your file in file dialog or you can run webcam.
- Dataset consist of 7,553 images combined manually.
- Adam is used as optimizer and Categorical Crossentropy is used as a loss function.
Figure 1: With Mask
Figure 2: Without Mask
- Jupyter Notebook version 6.1 or above
- Python version 3.8 or above
- Python Libraries Used:
- numpy https://numpy.org/doc/
- pandas https://pandas.pydata.org/docs/
- TensorFlow https://www.tensorflow.org/api_docs
- OpenCV https://docs.opencv.org/3.4/
- scikit-learn https://scikit-learn.org/stable/user_guide.html
- keras https://keras.io/guides/
- matplotlib https://matplotlib.org/stable/users/index.html
- tkinter https://docs.python.org/3/library/tkinter.html
The plots of Model Accuracy and Model Loss are as follows:
To use this project on your system, follow these steps:
- Clone this repository onto your system by typing the following command on your Command Prompt:
git clone https://github.com/parvanehyaghoubi/Face_Mask_Detection
- Download all libaries using:
pip install -r requirements.txt
- Run the application:
python main_mask_detector.py
- You can see an environment which create with tkinter:
- If you choose
Open a File
, the file dialog opens and you can choose your video
- If you choose
Open Camera
, you can use your camera to face mask detection!!
For any inquiries or feedback, please contact: