All Projects โ†’ PureHing โ†’ face-mask-detection-tf2

PureHing / face-mask-detection-tf2

Licence: MIT license
A face mask detection using ssd with simplified Mobilenet and RFB or Pelee in Tensorflow 2.1. Training on your own dataset. Can be converted to kmodel and run on the edge device of k210

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to face-mask-detection-tf2

brfv4 win examples
Windows C++ examples utilizing OpenCV for camera access and drawing the face tracking results.
Stars: โœญ 13 (-81.94%)
Mutual labels:  detection, face-detection
Cnn Paper2
๐ŸŽจ ๐ŸŽจ ๆทฑๅบฆๅญฆไน  ๅท็งฏ็ฅž็ป็ฝ‘็ปœๆ•™็จ‹ ๏ผšๅ›พๅƒ่ฏ†ๅˆซ๏ผŒ็›ฎๆ ‡ๆฃ€ๆต‹๏ผŒ่ฏญไน‰ๅˆ†ๅ‰ฒ๏ผŒๅฎžไพ‹ๅˆ†ๅ‰ฒ๏ผŒไบบ่„ธ่ฏ†ๅˆซ๏ผŒ็ฅž็ป้ฃŽๆ ผ่ฝฌๆข๏ผŒGAN็ญ‰๐ŸŽจ๐ŸŽจ https://dataxujing.github.io/CNN-paper2/
Stars: โœญ 77 (+6.94%)
Mutual labels:  detection, face-detection
Brfv4 javascript examples
BRFv4 - HTML5/Javascript - examples project. Reference implementation for all other platform example packages.
Stars: โœญ 460 (+538.89%)
Mutual labels:  detection, face-detection
ARFaceFilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: โœญ 72 (+0%)
Mutual labels:  detection, face-detection
Dockerface
Face detection using deep learning.
Stars: โœญ 173 (+140.28%)
Mutual labels:  detection, face-detection
jeelizGlanceTracker
JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.
Stars: โœญ 68 (-5.56%)
Mutual labels:  detection, face-detection
Catt
Detecting the temperature from an infrared image
Stars: โœญ 60 (-16.67%)
Mutual labels:  detection, face-detection
Tiny
Tiny Face Detector, CVPR 2017
Stars: โœญ 1,079 (+1398.61%)
Mutual labels:  detection, face-detection
brfv4 android examples
Android Studio project (Java)
Stars: โœญ 43 (-40.28%)
Mutual labels:  detection, face-detection
Jeelizfacefilter
Javascript/WebGL lightweight face tracking library designed for augmented reality webcam filters. Features : multiple faces detection, rotation, mouth opening. Various integration examples are provided (Three.js, Babylon.js, FaceSwap, Canvas2D, CSS3D...).
Stars: โœญ 2,042 (+2736.11%)
Mutual labels:  detection, face-detection
FaceRecognition With FaceNet Android
Face Recognition using the FaceNet model and MLKit on Android.
Stars: โœญ 113 (+56.94%)
Mutual labels:  face-detection, tensorflow2
RFBNet
Receptive Field Block Net for Accurate and Fast Object Detection, ECCV 2018
Stars: โœญ 1,380 (+1816.67%)
Mutual labels:  detection, rfbnet
Deep-Learning
This repo provides projects on deep-learning mainly using Tensorflow 2.0
Stars: โœญ 22 (-69.44%)
Mutual labels:  face-detection, tensorflow2
farm-animal-tracking
Farm Animal Tracking (FAT)
Stars: โœญ 19 (-73.61%)
Mutual labels:  detection, tensorflow2
UnitBox
UnitBox: An Advanced Object Detection Network
Stars: โœญ 23 (-68.06%)
Mutual labels:  face-detection, tensorflow2
Sod
An Embedded Computer Vision & Machine Learning Library (CPU Optimized & IoT Capable)
Stars: โœญ 1,460 (+1927.78%)
Mutual labels:  detection, face-detection
Extd pytorch
Official EXTD Pytorch code
Stars: โœญ 177 (+145.83%)
Mutual labels:  detection, face-detection
timeline
Timeline - A photo organizer
Stars: โœญ 39 (-45.83%)
Mutual labels:  detection, face-detection
FaceAware-Android
this helps to auto zoom for face on ImageView
Stars: โœญ 46 (-36.11%)
Mutual labels:  face-detection
ETWNetMonv3
ETWNetMonv3 is simple C# code for Monitoring TCP Network Connection via ETW & ETWProcessMon/2 is for Monitoring Process/Thread/Memory/Imageloads/TCPIP via ETW + Detection for Remote-Thread-Injection & Payload Detection by VirtualMemAlloc Events (in-memory) etc.
Stars: โœญ 32 (-55.56%)
Mutual labels:  detection

Face mask detection

This model is a lightweight face mask detection model. Based on ssd,the backbone is Mobilenet and RFB.

Key Features

  • Tensorflow 2.1
  • Trainging and Inference
  • Precision with mAP
  • Eager mode training with tf.GradientTape
  • Network function with tf.keras
  • Dataset prepocessing with tf.data.TFRecordDataset
โ”œโ”€โ”€ assets
โ”‚   โ”œโ”€โ”€ 1_Handshaking_Handshaking_1_71.jpg
โ”‚   โ”œโ”€โ”€ out_1_Handshaking_Handshaking_1_71.jpg
โ”‚   โ”œโ”€โ”€ out_test_00002330.jpg
โ”‚   โ””โ”€โ”€ test_00002330.jpg
โ”œโ”€โ”€ checkpoints
โ”‚   โ””โ”€โ”€ weights_epoch_100.h5
โ”œโ”€โ”€ components
โ”‚   โ”œโ”€โ”€ config.py
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ kmeans.py
โ”‚   โ”œโ”€โ”€ prior_box.py
โ”‚   โ””โ”€โ”€ utils.py
โ”œโ”€โ”€ dataset
โ”‚   โ”œโ”€โ”€ check_dataset.py
โ”‚   โ”œโ”€โ”€ tf_dataset_preprocess.py
โ”‚   โ”œโ”€โ”€ train_mask.tfrecord
โ”‚   โ”œโ”€โ”€ trainval_mask.tfrecord
โ”‚   โ”œโ”€โ”€ val_mask.tfrecord
โ”‚   โ”œโ”€โ”€ voc_to_tfrecord.py
โ”œโ”€โ”€ inference.py
โ”œโ”€โ”€ logs
โ”‚   โ””โ”€โ”€ train
โ”œโ”€โ”€ mAP
โ”‚   โ”œโ”€โ”€ compute_mAP.py
โ”‚   โ”œโ”€โ”€ detection-results
โ”‚   โ”œโ”€โ”€ detect.py
โ”‚   โ”œโ”€โ”€ ground-truth
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ map-results
โ”‚   โ””โ”€โ”€ README.md
โ”œโ”€โ”€ Maskdata
โ”‚   โ”œโ”€โ”€ Annotations
โ”‚   โ”œโ”€โ”€ ImageSets
โ”‚        โ””โ”€โ”€ Main
โ”‚   โ”‚       โ”œโ”€โ”€ train.txt
โ”‚   โ”‚       โ”œโ”€โ”€ trainval.txt
โ”‚   โ”‚       โ””โ”€โ”€ val.txt
โ”‚   โ””โ”€โ”€ JPEGImages
โ”œโ”€โ”€ network
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ losses.py
โ”‚   โ”œโ”€โ”€ model.py
โ”‚   โ”œโ”€โ”€ net.py
โ”‚   โ”œโ”€โ”€ network.py
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ train.py
โ””โ”€โ”€ requirements.txt

Usage

Installation

Create a new python virtual environment by Anaconda ,pip install -r requirements.txt

Data Preparing

  1. Face Mask Data

    Source data from AIZOOTech , which is a great job.

    I checked and corrected some error to apply my own training network according to the voc dataset format. You can download it here:

  2. Data Processing

    • Download the mask data images

    • Convert the training images and annotations to tfrecord file with the the script bellow.

      python dataset/voc_to_tfrecord.py --dataset_path Maskdata/  --output_file dataset/train_mask.tfrecord --split train

      you can change the --split parameters to 'val' to get the validation tfrecord, Please modify the inside setting voc_to_tfrecord.py for different situations.

  3. Check tfrecord dataloader by run python dataset/check_dataset.py .

Training

  1. Modify your configuration in components/config.py.

    You can get the anchors by run python components/kmeans.py

  2. Train the model by run python train.py .

Inference

  • Run on video

    python inference.py  --model_path checkpoints/ --camera True
    or
    python inference.py  --model_path checkpoints/*.h5 --camera True
  • Detect on Image

    python inference.py  --model_path checkpoints/ --img_path assert/1_Handshaking_Handshaking_1_71.jpg

mAP

  • Convert xml to txt file on mAP/ground truth, predicting the bbox and class on mAP/detection-results.

     python mAP/detect.py --model_path checkpoints/ --dataset_path Maskdata/ --split val 
    
     python mAP/compute_mAP.py

For K210 project:

something refer to k210-camera-project.

Reference

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