All Projects → ksvbka → face-mask-detector

ksvbka / face-mask-detector

Licence: MIT license
Detecting face mask with OpenCV and TensorFlow. Using simple CNN or model provided by TensorFlow as MobileNetV2, VGG16, Xception.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to face-mask-detector

Facerecognition
Nextcloud app that implement a basic facial recognition system.
Stars: ✭ 226 (+1089.47%)
Mutual labels:  face-detection
Face-Recognition
A Java application for Face Recognition under expressions, occlusions and pose variations.
Stars: ✭ 55 (+189.47%)
Mutual labels:  face-detection
myphotoshare
MOVED TO GITLAB! --- A Web 2.0 Photo Gallery Done Right via Static JSON, Dynamic Javascript and a bit of php for sharing
Stars: ✭ 12 (-36.84%)
Mutual labels:  face-detection
Cnn face detection
Implementation based on the paper Li et al., “A Convolutional Neural Network Cascade for Face Detection, ” 2015 CVPR
Stars: ✭ 251 (+1221.05%)
Mutual labels:  face-detection
Applefacedetection
Face Detection with CoreML
Stars: ✭ 254 (+1236.84%)
Mutual labels:  face-detection
assap
Anti Shoulder Surfing Attack Platform (ASSAP)
Stars: ✭ 22 (+15.79%)
Mutual labels:  face-detection
Wear A Mask
😷 An SPA that uses only the front-end to perform deep-learning-based facial landmark detection on images and automatically adds breathing mask stickers.
Stars: ✭ 226 (+1089.47%)
Mutual labels:  face-detection
pigo-wasm-demos
Webassembly demos showcasing the Pigo face detection library.
Stars: ✭ 47 (+147.37%)
Mutual labels:  face-detection
Awesome Face recognition
papers about Face Detection; Face Alignment; Face Recognition && Face Identification && Face Verification && Face Representation; Face Reconstruction; Face Tracking; Face Super-Resolution && Face Deblurring; Face Generation && Face Synthesis; Face Transfer; Face Anti-Spoofing; Face Retrieval;
Stars: ✭ 3,220 (+16847.37%)
Mutual labels:  face-detection
Face-Recognition-Raspberry-Pi-64-bits
Recognize 2000+ faces on your Raspberry Pi 4 with database auto-fill and anti-spoofing
Stars: ✭ 48 (+152.63%)
Mutual labels:  face-detection
Add Christmas Hat
Add Christmas hat on one's head based on OpneCV and Dlib
Stars: ✭ 251 (+1221.05%)
Mutual labels:  face-detection
Img2pose
The official PyTorch implementation of img2pose: Face Alignment and Detection via 6DoF, Face Pose Estimation - CVPR 2021
Stars: ✭ 247 (+1200%)
Mutual labels:  face-detection
google-vision-sampler
Code examples for Google Vision API.
Stars: ✭ 47 (+147.37%)
Mutual labels:  face-detection
Facepapercollection
A collection of face related papers
Stars: ✭ 241 (+1168.42%)
Mutual labels:  face-detection
morghulis
No description or website provided.
Stars: ✭ 18 (-5.26%)
Mutual labels:  face-detection
Retinaface
The remake of the https://github.com/biubug6/Pytorch_Retinaface
Stars: ✭ 226 (+1089.47%)
Mutual labels:  face-detection
facial-expression-recognition
Facial Expression Recognition Using CNN and Haar-Cascade
Stars: ✭ 44 (+131.58%)
Mutual labels:  face-detection
bob
Bob is a free signal-processing and machine learning toolbox originally developed by the Biometrics group at Idiap Research Institute, in Switzerland. - Mirrored from https://gitlab.idiap.ch/bob/bob
Stars: ✭ 38 (+100%)
Mutual labels:  face-detection
Detect-Facial-Features
Code example demonstrating how to detect eyes, nose, lips, and jaw with dlib, OpenCV, and Python
Stars: ✭ 42 (+121.05%)
Mutual labels:  face-detection
DeepFaceRecognition
Face Recognition with Transfer Learning
Stars: ✭ 16 (-15.79%)
Mutual labels:  face-detection

Face Mask Detection

GitHub PyPI - Python Version

Detecting face mask with OpenCV and TensorFlow. Using simple CNN or model provided by TensorFlow as MobileNetV2, VGG16, Xception.

Demo

Data

Raw data collected from kaggle and script crawl_image.py, split to 'Mask' and 'Non Mask' class.

Using build_data.py to extract faces from raw dataset and resize to 64x64.

Installation

Clone the repo

git clone [email protected]:ksvbka/face-mask-detector.git

cd to project folder and create virtual env

virtualenv .env
source .env/bin/activate
pip install -r requirements.txt

Download raw dataset and execute script build_dataset.py to preprare dataset for training

cd data
bash download_data.sh
cd -
python3 build_dataset.py --data-dir data/dataset_raw/ --output-dir data/64x64_dataset

Training

Execute train.py script and pass network architecture type dataset dir and epochs to it. Default network type is MobileNetV2.

python3 train.py --net-type MobileNetV2 --data-dir data/64x64_dataset --epochs 20

View tensorboard

tensorboard --logdir logs --bind_all

Testing

python3 mask_detect_image.py -m results/MobileNetV2-size-64-bs-32-lr-0.0001.h5 -i demo_image/2.jpg

Result

Hyperparameter: - batch size: 32 - Learing rate: 0.0001 - Input size: 64x64x3

Model result

Model Test Accuracy Size Params Memory consumption
CNN 87.67% 27.1MB 2,203,557 72.58 MB
VGG16 93.08% 62.4MB 288,357 18.06 MB
MobileNetV2 (fine tune) 97.33% 20.8MB 1,094,373 226.67 MB
Xception 98.33% 96.6MB 1,074,789 368.18 MB

Download pre-trained model: link

Demo

Using MobileNetV2 model

Demo Demo Demo Demo Demo Demo Demo Demo Demo

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].