All Projects → rakshit087 → Face-Mask-Detection-PyTorch

rakshit087 / Face-Mask-Detection-PyTorch

Licence: other
A real-time face mask detector based on computer vision and deep learning, created using Pytorch and OpenCV

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Face-Mask-Detection-PyTorch

InsightFace-REST
InsightFace REST API for easy deployment of face recognition services with TensorRT in Docker.
Stars: ✭ 308 (+2466.67%)
Mutual labels:  face-recognition, mask-detection
Facerecognize For Mobile Phone
适用于移动端的人脸识别模型,计算量与mobilefacenet相同,但megaface上提升了2%+
Stars: ✭ 229 (+1808.33%)
Mutual labels:  face-recognition, mobilenetv2
RMNet
RM Operation can equivalently convert ResNet to VGG, which is better for pruning; and can help RepVGG perform better when the depth is large.
Stars: ✭ 129 (+975%)
Mutual labels:  mobilenetv2
Music player with Emotions recognition
This program can recognize your mood by detecting your face and play song according your mood
Stars: ✭ 79 (+558.33%)
Mutual labels:  face-recognition
PyVGGFace
VGG-Face CNN descriptor in PyTorch.
Stars: ✭ 21 (+75%)
Mutual labels:  face-recognition
RealTimeFaceRecognitionExample
This asset is an example project of face recognition in real time using “OpenCV for Unity”.
Stars: ✭ 18 (+50%)
Mutual labels:  face-recognition
easy-real-time-face-recognition-python
No description or website provided.
Stars: ✭ 30 (+150%)
Mutual labels:  face-recognition
iqiyi-vid-challenge
Code for IQIYI-VID(IQIYI Video Person Identification) Challenge Implemented in Python and MXNet
Stars: ✭ 45 (+275%)
Mutual labels:  face-recognition
MaskedFaceRepresentation
Masked face recognition focuses on identifying people using their facial features while they are wearing masks. We introduce benchmarks on face verification based on masked face images for the development of COVID-safe protocols in airports.
Stars: ✭ 17 (+41.67%)
Mutual labels:  face-recognition
face-recognition
A GPU-accelerated real-time face recognition system based on classical machine learning algorithms
Stars: ✭ 24 (+100%)
Mutual labels:  face-recognition
ofFaceRecognition
simple example face recognition with deep metric learning to dlib
Stars: ✭ 20 (+66.67%)
Mutual labels:  face-recognition
microsoft-he4rt
A 2 day challenge to develop any project using Microsoft Graph and Azure
Stars: ✭ 15 (+25%)
Mutual labels:  face-recognition
PyRecognizer
"A neural network to rule them all, a neural network to find them, a neural network to bring them all and verify if is you !!" (Face recognition tool)
Stars: ✭ 28 (+133.33%)
Mutual labels:  face-recognition
FaceRecognition
Face Recognition in real-world images [ICASSP 2017]
Stars: ✭ 36 (+200%)
Mutual labels:  face-recognition
CPG
Steven C. Y. Hung, Cheng-Hao Tu, Cheng-En Wu, Chien-Hung Chen, Yi-Ming Chan, and Chu-Song Chen, "Compacting, Picking and Growing for Unforgetting Continual Learning," Thirty-third Conference on Neural Information Processing Systems, NeurIPS 2019
Stars: ✭ 91 (+658.33%)
Mutual labels:  face-recognition
face unlock
We can lock and unlock our Ubuntu system using face recognition(currently only on Ubuntu).
Stars: ✭ 48 (+300%)
Mutual labels:  face-recognition
esp32-custom-vision
A simple face recognition using ESP32 Microcontroller with camera, and leveraging cloud-based inference powered by Azure Custom Vision.
Stars: ✭ 43 (+258.33%)
Mutual labels:  face-recognition
clockon-clockoff-face-recognition
Face Recognize application. Using FaceNet and CoreML
Stars: ✭ 21 (+75%)
Mutual labels:  face-recognition
Recogcis
Face detection & recognition AR app using the mlmodel to recognize company employees.
Stars: ✭ 28 (+133.33%)
Mutual labels:  face-recognition
face-recognition
Face recognition using eigenfaces technique
Stars: ✭ 20 (+66.67%)
Mutual labels:  face-recognition

Face Mask Detection using PyTorch

A simple Face Mask Detection Model created using PyTorch and OpenCV.

📃 Installation

  1. Clone the repo
$ git clone https://github.com/rakshit087/facemaskDetectorPytorch.git
  1. Now, cd the cloned repo and install the dependencies by (You can use virtualenv for this purpose)
cd /YOUR_PATH/facemaskDetectorPytorch
$ pip3 install -r requirements.txt

💻 Usage

🔹The faceExtractor can be used to extract face images from pictures. This is what I used to improve my dataset. Put your Images in the 'Images' folder and all the Extracted faces will saved in the 'saved' folder after running the app.py

$cd /YOUR_PATH/facemaskDetectorPytorch/Face_Extractor 
$python app.py

🔹You can train your own model, but for that first you need your own dataset. The dataset must have the following structure-

.Train_Model
├── data                       # your dataset folder
│   ├── train                  # to train your data
│       ├── mask
│       └── no_mask
│   └── test                   # to test your model
│       ├── mask
│       └── no_mask
└── Train_Model.py 

After creating the dataset you can train your model by using 'Train_Model.py', after training the model, if you are satisfied by the results you can save the model when asked. The trained model will be saved in the same directory.

$cd /YOUR_PATH/facemaskDetectorPytorch/Train_Model 
$python Train_Model.py

🔹 You can use a pretrained model with the help of 'faceDetect.py', by default it will load the model I trained.

$cd /YOUR_PATH/facemaskDetectorPytorch/Use_Model 
$python faceDetect.py

📁 Dataset Used

I created a custom dataset by mixing images from various sources.
🔹Cabani's Dataset - I used it to get images of people wearing mask
🔹Real vs Fake Face - I used it to get images of people not wearing a mask.
🔹I also some some personal images of my friends and family and extracted faces with the help of 'Face_Extractor'


🧠 Model Details

The model used Transfer Learning using MobileNetv2 (The parameters were freezed) as the base and I changed the classifier to -

Linear Layer (input - 1280 | output - 256 | Activation - ReLU)
⬇️
Linear Layer (input - 256 | output - 128 | Activation - ReLU | Dropout = 0.4)
⬇️
Linear Layer (input - 128 | output - 64 | Activation - ReLU)
⬇️
Linear Layer (input - 64 | output - 32 | Activation - ReLU | Dropout = 0.4)
⬇️
Linear Layer (input - 32 | output - 2 | Activation - SoftMax)

⚠️ Issues and Limitations

🔹 The model is having a hard time to detect dark masks, I tried to improve it by adding some dark mask images but somhow, the model started giving false positive to by beard face. 😛


💜 Thank You

Resources, study material and everything in between -

Deep Learning Specialization I learned deep learning from here, after completing the 4th Course, I decided to start this project.

PyTorch Crash Couse - By Sentdex. I learned Pytorch from here. Really awesome playlist with to the point explanation.

MobileNet with Pytorch I used official documentations as a reference for transfer learning.

Chandrika Deb's Mask Detector It is a similar project, so whenever I was lost, I used this as a reference. Also the Readme of this project is heavily inspired by her's

PS-I recently learned deep learning, so there may be a better approch to this project. Any kind of improvement or suggestions are most welcomed.

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].