A real-time face mask detection desktop application built with Python, TensorFlow, OpenCV, and Tkinter.
The app can detect whether a person is wearing a mask using your webcam or uploaded images, with a simple graphical interface.
- 🎥 Real-time face detection via webcam
- 🖼️ Option to test detection using image files
- 🧠 Deep learning model (CNN) trained on masked/unmasked face datasets
- 💻 Simple and interactive Tkinter GUI
- 🧩 Model built with TensorFlow/Keras for accurate classification
The deep learning model is trained using a Convolutional Neural Network (CNN) that classifies faces as either:
- Mask 😷
- No Mask 🚫
The model can be further improved or retrained using your own dataset.
- Python 3.10+
- Tkinter (GUI)
- TensorFlow / Keras
- OpenCV
- NumPy
- Pillow
- Imutils
- Rich (for styled console output)
-
Clone the repository
git clone https://github.com/salimdotpy/Face_mask_dection_app.git cd Face_mask_detection_app -
Create and activate a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python app.py
-
(Optional) Build a standalone executable To package your app into an .exe file:
pyinstaller --onefile --noconsole app.py
🧩 Example Output Mode Output Webcam Detects and labels "Mask" or "No Mask" in real-time Image Displays prediction on uploaded photo
🤝 Contributing Contributions, suggestions, and improvements are welcome! Feel free to open an issue or submit a pull request.
👨💻 Author
Selim Adekola 📧 salimdotpy@gmail.com 📞 +2348076738293