Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Face mask detection on a bare Raspberry Pi 4 wit 32 or 64-bit OS

License

NotificationsYou must be signed in to change notification settings

Qengineering/TensorFlow_Lite_Face_Mask_RPi_64-bits

Repository files navigation

output image Find this example on ourSD-image

TensorFlow_Lite_Face_Mask_RPi_64-bits

output image

TensorFlow Lite Face Mask detection running on a bare Raspberry Pi 4.

License

A fast C++ implementation of TensorFlow Lite Face Mask detector on a bare Raspberry Pi 4 with a 32 or 64-bit operating system. Ubuntu 18.04, or Ubuntu20.04 are also possible.
Once overclocked to 1900 MHz, your app runs at 8.3 FPS without any hardware accelerator.

You could call this Face Mask detection2.0.
The network used is a re-trained MobileNet V2 SSD. It has three classes: no maks, a mask, and wearing a mask incorrectly. Although the latter category is not very convincing, given the small size of training samples.
It's not the usual cascade of the two deep learning models, one face recognition and a second one that detects the masks.
This one model now recognizes not only the white masks, but also the black, colored and fancy masks.
Although it can detect more faces/masks in the same scene, the best result is still one face in front of the camera.

Update 8-29-2022.

  • Added GPIO outputs.

Benchmark.

ModelRPi 4 64os 1900 MHzRPi 4 64os 1500 MHz
ssd_mobilenet_v2.tflite8.1 FPS7.5 FPS
ssd_mobilenet_v2_fpnlite.tflite6.3 FPS5.8 FPS

Special made for a Raspberry Pi 4 seeQ-engineering deep learning examples


Dependencies.

To run the application, you have to:


Running the app.

To extract and run the network in Code::Blocks
$ mkdirMyDir
$ cdMyDir
$ wgethttps://github.com/Qengineering/TensorFlow_Lite_Face_Mask_RPi_64-bits/archive/refs/heads/main.zip
$ unzip -j master.zip
Remove master.zip, LICENSE and README.md as they are no longer needed.
$ rm master.zip
$ rm README.md

YourMyDir folder must now look like this:
Face_Mask_Video.mp4
ssd_mobilenet_v2_fpnlite.tflite - more accurate
ssd_mobilenet_v2.tflite - somewhat faster
TestTensorFlow_Lite_Mask.cpb
FaceMask.cpp
Kapje_x.jpg - examples

Run TestTensorFlow_Lite.cpb with Code::Blocks.


WebCam.

If you want to use a camera please alter line 130 in main.cpp to
cv::VideoCapture cap(0); //WebCam
If you want to run a movie please alter line 130 in main.cpp to
cv::VideoCapture cap("Face_Mask_Video.mp4"); //Movie


Thanks.

https://www.kaggle.com/andrewmvd/face-mask-detection
https://github.com/tanhouren/Face_mask_detector


paypal

output image
output image
output image


[8]ページ先頭

©2009-2025 Movatter.jp