Face Mask Detection System
Face mask detection: finds faces (YuNet) and classifies mask / no mask with MobileNetV2 on pictures, folders and a live webcam, with alerts, log and retraining. Python, TensorFlow, OpenCV, Tkinter.
- Price: ₹1,999
- Category: AI / ML
- Technology: Python, TensorFlow / Keras (MobileNetV2), OpenCV (YuNet face finder), Tkinter, SQLite
- Includes: Full source code
- Suitable for: BCA / B.Sc CS, MCA / M.Sc CS, B.E / B.Tech CSE & IT
Project overview
Offices, hospitals, schools and shops need to know whether people are wearing masks, and doing it by eye does not scale. This application finds the faces and checks each one. A compact face finder (YuNet, MIT licence) locates faces - also masked ones - and a MobileNetV2 network, pre-trained on ImageNet and fine-tuned on mask / no-mask pictures with flips, rotations, zoom and brightness changes, decides MASK or NO MASK for every face. On a held-out set of real photographs the model reaches about 99 percent; on the drawn faces it was also trained on it reaches about 100 percent. Results appear as green and red boxes with confidence, the number of people with and without masks and the compliance percentage. Use it on a single picture, on a whole folder with a CSV result, or live with a webcam, where a red alert banner and a log entry appear whenever someone without a mask is in view. The Train screen shows the training curve and confusion matrix and lets you retrain with your own pictures. Because the training photographs belong to other people, none are included: the demo pictures are cartoon people drawn by us.
Modules
- Login: Admin login with a salted password hash; change the password from the side menu.
- Detect: Check one picture (or a demo picture): faces, mask / no mask, confidence, compliance; save the result picture.
- Webcam: Live camera with boxes, counts, a red alert banner and log entries; save a snapshot.
- Batch: Check every picture in a folder and save the counts to CSV.
- Train: Retrain the classifier on your own pictures with a live curve and confusion matrix.
- Log: Every check with faces / mask / no mask / alerts, compliance totals; CSV export.
Requirements
- Python 3.11
- Internet once, to install the libraries (about 10 minutes, downloads about 500 MB)
- Windows 10 / 11
How to run this project
- Install Python 3.11 from python.org and tick "Add python.exe to PATH" during setup.
- Extract the zip and open the project folder (STUDENT_GUIDE.md explains every step in simple words).
- Double-click `1_INSTALL.bat` once and wait until it says [OK] (about 10 minutes, downloads about 500 MB; it downloads the libraries into a private .venv folder).
- Double-click `2_RUN.bat` to start the project. If it does not start, double-click `CHECK_SETUP.bat` and read what it says.
- Log in with admin / admin123.
- Open Batch, choose the 'samples' folder and click 'Check all and save CSV'. Open Train to show the accuracy and confusion matrix; open Log for the totals.