Skip to content

EscVM/Edge_TPU_Face_Mask_Detection

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

License

~ Face Mask Detection with Edge TPU ~

Face mask detection on Edge TPU at more than 50 fps. The code is very straightforward: there's a network trained to recognize faces in an image and another one that detects the presence of the mask. The first network can be found here, and the second one has been trained with this little dataset (A Colab notebook is provided to train a new classifier on top of a different backbone). Everything is optimized for Edge TPU inference, but it's possible to run all the code on a CPU changing configurations. Only opencv-python and the TensorFlow-Lite interpreter are needed. As it's possible to see in the example below, it runs around 50 fps with a couple of faces with less than 3W! Enjoy 👨‍💻

1.0 Getting Started

Clone this repository

git clone https://github.com/EscVM/Edge_TPU_Face_Mask_Detection

1.1 Installations for the hosting device

Install on the hosting device the following libraries:

2.0 Run Face Mask Detector

python3 main.py

Instead, if you want a mini server version, run the following command:

python3 main_server.py

Once started, search on your browser localhost:8080. Login with the username and password 'admin'/'admin' (what👀?).

3.0 Train and Optimize a New Mask Detector

With the following notebook you can easily train a new classifier on top of whitchever backbone found here(almost). Once trained and converted you can place it in the models folder. Rember to change paths in the detector module.

Open In Colab

About

Real time face mask detection system with edge TPUs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published