ML - Facemask Detection i.MX 8M Plus NPU Demo

Published on January 28, 2021

This blog post will detail how Boundary Devices created its Facemask Detection app for the i.MX 8M Plus-based Nitrogen8MP and its NPU! It was done as part of our i.MX 8M Plus Machine Learning webinar which you can see here:

Facemask Detection app details

History

We decided to create a demo leveraging the i.MX 8M Plus NPU when COVID was spreading worldwide. So it became obvious that an application detecting whether or not a person is wearing a mask was a great example. Not only does it show how machine learning can be used to track and recognize a face, a model can be created to learn if the detected face has a specific attribute, like a mask.

Hardware setup

For this demo, we used our Nitrogen8M Plus Evaluation Kit Bundle which includes:

Software details

Overall architecture

After some investigation, we decided to use the following:
  • OS: Android 10 (BSP 2.5.0)
    • Pre-built images available here
    • Plenty of examples apps available
    • NNAPI supported by NXP
  • Inference Engine: TensorFlow Lite
    • Using existing example to build demo
    • Customized model for face mask detection

Leveraging existing projects

This application was possible thanks to several other projects: Credit: Esteban Uri (Medium article)

Demo

Here is a snippet of our webinar showing the Facemask Detection app which can be downloaded here.  
[embed]https://www.youtube.com/watch?v=4sG2U8Vx480[/embed]
As always, let us know if you have any questions or feedback!