Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Qengineering/Face-Mask-Detection-Raspberry-Pi-64-bits
Face mask detection on Raspberry Pi 4
https://github.com/Qengineering/Face-Mask-Detection-Raspberry-Pi-64-bits
aarch64 armv8 cpp deep-learning face-detection face-mask face-mask-detection face-recognition high-fps ncnn ncnn-framework paddle-lite paddlepaddle raspberry-pi-4 ssd-model ubuntu
Last synced: 3 months ago
JSON representation
Face mask detection on Raspberry Pi 4
- Host: GitHub
- URL: https://github.com/Qengineering/Face-Mask-Detection-Raspberry-Pi-64-bits
- Owner: Qengineering
- License: bsd-3-clause
- Created: 2020-06-23T16:05:56.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T14:39:14.000Z (almost 4 years ago)
- Last Synced: 2024-10-18T04:38:52.146Z (4 months ago)
- Topics: aarch64, armv8, cpp, deep-learning, face-detection, face-mask, face-mask-detection, face-recognition, high-fps, ncnn, ncnn-framework, paddle-lite, paddlepaddle, raspberry-pi-4, ssd-model, ubuntu
- Language: C++
- Homepage: https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html
- Size: 5.22 MB
- Stars: 58
- Watchers: 4
- Forks: 14
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-ncnn - Face-Mask-Detection-Raspberry-Pi-64-bits
README
![output image](https://qengineering.eu/images/SDcard16GB_tiny.jpg) Find this example on our [SD-image](https://github.com/Qengineering/RPi-image)
# Face Mask Detection on Raspberry Pi 64 bits
![output image]( https://qengineering.eu/images/FamilyOut.jpg )## A fast face mask recognition running at 24-5 FPS on bare a Raspberry Pi 4.
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
This is a fast C++ implementation of two deep learning models found in the public domain.
The first is face detector of Linzaer running on a ncnn framework.
https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB.
The second is the Paddle Lite mask detection which classifies the found faces.
https://github.com/PaddlePaddle/Paddle-Lite/tree/develop/lite/demo/cxx/mask_detection.
The frame rate depends on the number of detected faces and can be calculated as follows:
FPS = 1.0/(0.04 + 0.01 x #Faces) when overclocked to 1950 MHz.
Paper: https://arxiv.org/abs/1905.00641.pdf
Size: 320x320
Special made for a bare Raspberry Pi see [Q-engineering deep learning examples](https://qengineering.eu/deep-learning-examples-on-raspberry-32-64-os.html)
### New version 2.0.
A new and superior version with only __TensorFlow Lite__ for a bare Raspberry Pi see [GitHub](https://github.com/Qengineering/TensorFlow_Lite_Face_Mask_RPi_64-bits)
## Dependencies.
To run the application, you have to:
- A raspberry Pi 4 with a 64-bit operating system. It can be the Raspberry 64-bit OS, or Ubuntu 18.04 / 20.04. [Install 64-bit OS](https://qengineering.eu/install-raspberry-64-os.html)
- The Paddle Lite framework installed. [Install Paddle](https://qengineering.eu/install-paddle-on-raspberry-pi-4.html)
- The Tencent ncnn framework installed. [Install ncnn](https://qengineering.eu/install-ncnn-on-raspberry-pi-4.html)
- OpenCV 64 bit installed. [Install OpenCV 4.5](https://qengineering.eu/install-opencv-4.5-on-raspberry-64-os.html)
- Code::Blocks installed. (```$ sudo apt-get install codeblocks```)
## Running the app.
To extract and run the network in Code::Blocks
$ mkdir *MyDir*
$ cd *MyDir*
$ wget https://github.com/Qengineering/Face-Mask-Detection-Raspberry-Pi-64-bits/archive/refs/heads/master.zip
$ unzip -j master.zip
Remove master.zip and README.md as they are no longer needed.
$ rm master.zip
$ rm README.md
Your *MyDir* folder must now look like this:
Face_1.jpg
Face_2.jpg
Face_3.jpg
Face_Mask_Video.mp4
MaskUltra.cpb
mask_ultra.cpp
UltraFace.cpp
UltraFace.hpp
RFB-320.bin
RFB-320.param
slim_320.bin
slim_320.param
The RFB-320 model recognizes slightly more faces than slim_320 at the expense of a little bit of speed. It is up to you.
Note that the compilation of the Paddle Lite framework in your application can take minutes (> 3 min).
See the video at https://youtu.be/LDPXgJv3wAk