Giter Club home page Giter Club logo

face-mask-detection-raspberry-pi-64-bits's Introduction

output image Find this example on our SD-image

Face Mask Detection on Raspberry Pi 64 bits

output image

A fast face mask recognition running at 24-5 FPS on bare a Raspberry Pi 4.

License

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

New version 2.0.

A new and superior version with only TensorFlow Lite for a bare Raspberry Pi see GitHub

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
  • The Paddle Lite framework installed. Install Paddle
  • The Tencent ncnn framework installed. Install ncnn
  • OpenCV 64 bit installed. Install OpenCV 4.5
  • 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

face-mask-detection-raspberry-pi-64-bits's People

Contributors

qengineering avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

face-mask-detection-raspberry-pi-64-bits's Issues

Running App Problem

Hello There,
I follow your guide, to run the application. I installed all dependencies follow by links, then downloaded and extracted the project in MyDir folder. After that I opened the project by CodeBlocks, and build it successfully, but when I ran the project in new paddle lite said "The Model File is not supported".
Help me to fix this problem, please.
Thanks a lot

Keeps crashing

Very crashy. Has some problems. Was running just fine before I decided to update

Functional compilation with static library

Installation on a raspberrypios Bullseye aarch64 of Paddle-lite 2.10.
unable to get a shared library recognized by this application, (Face-Mask-Detection-Raspberry-Pi-64-bits).
So to get a static library, I ran ./lite/tools/build_linux.sh after modifying the parameters in the header of the script:
WITH_EXTRA=ON
WITH_STATIC_LIB=ON
WITH_CV=ON
The script generates a static library and a dynamic (unrecognized) library.
The compilation (a little laborious) with the static library makes it possible to obtain a functional application.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.