Request for Face Recognition Example Using NPU on i.MX8M Plus on Android Platform

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Request for Face Recognition Example Using NPU on i.MX8M Plus on Android Platform

674 Views
mohamed_gaseen
Contributor IV

Hi NXP Team,

I am currently working with the i.MX8M Plus board and leveraging its NPU accelerator for machine learning workloads.

At present, my requirement is to implement face recognition with NPU acceleration on the Android platform (not Yocto-based). I would appreciate it if you could share a working reference or sample code that demonstrates face recognition using the NPU on Android.

If there are any specific models, Android SDKs, or dependencies required, kindly include those details as well.

Looking forward to your guidance and support.

Labels (2)
0 Kudos
Reply
11 Replies

644 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

You can see the face recognition demo on section 8.1.4 of the i.MX Machine Learning User's  guide, it works for android and yocto.

Regards

0 Kudos
Reply

635 Views
mohamed_gaseen
Contributor IV

Hi @Bio_TICFSL,

Thank you for your timely response and support.

Regarding the Machine Learning User Guide link you provided — I’d like to clarify that we are specifically looking for Android-based examples rather than Python implementations.

For reference, we successfully built and tested the Image Classification Android example from the following GitHub repository:
https://github.com/tensorflow/examples/tree/master/lite/examples/image_classification/android

This approach worked well for us.

We are now looking to implement Face Recognition using a similar Android-native approach. Would it be possible for you to share an Android example or source code for face recognition, ideally in a structure similar to the image classification example?

Having access to such an implementation would be extremely helpful for our ongoing work and integration.

Thanks in Advance.

0 Kudos
Reply

579 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

The demo is working in Android BSP, but from the console I think what you are looking is an app.

Regards

0 Kudos
Reply

545 Views
mohamed_gaseen
Contributor IV

Hi,

The default application (android.example.com.tflitecamerademo) runs successfully on the Android 14 BSP and primarily performs image classification. However, we require a face recognition demo application to run on the same BSP.

Could you please confirm whether NNAPI is equivalent to the NPU?

We observed a latency of 200 ms when using the CPU, whereas NNAPI achieves 12 ms.

0 Kudos
Reply

527 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

NNAPI is Neural Network API de android, This API use components of GPU and NPU.

Regards

0 Kudos
Reply

467 Views
mohamed_gaseen
Contributor IV

Thank you @Bio_TICFSL for your prompt response and for confirming NNAPI support on the i.MX8MP platform.

As a next step, I am looking for a face recognition example implemented in Android code, preferably utilizing NNAPI delegates to run on the NPU. While I have reviewed the Python-based examples provided in the eIQ documentation, I would appreciate a native Android application—similar to TensorFlow Lite Android examples—but tailored for face recognition.

Also could you please reply to these two points:

  • Do you have any VIT voice recognition running model on Android ?
  • Can you please find the attached image, here we're selecting NNAPI which is both GPU & NPU supported as you referred. But I want to specify only for GPU. Is there any possible way ?

 

NNAPI.jpeg

Kindly share a reference implementation or point me to any existing Android project that demonstrates face detection or recognition on i.MX8MP using NNAPI?

0 Kudos
Reply

357 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi,

Yes, you can apply this:

https://github.com/nxp-imx-support/imx-voiceplayer

 

Regards

0 Kudos
Reply

360 Views
mohamed_gaseen
Contributor IV

Hi @Bio_TICFSL ,

Is there any update regarding this??

Please support me with it ASAP.

0 Kudos
Reply

631 Views
varshilg
Contributor II

Hi @mohamed_gaseen ,

Glad to know that you are working on the IMX8M Plus board with NPU. I just want to clarify: since you mentioned that you are working on the Android platform, does that mean you are deploying your model not on a Yocto-based source, but rather using the AOSP source for deployment?

Regards,
Varshil

0 Kudos
Reply

624 Views
mohamed_gaseen
Contributor IV

Dear @varshilg,

Yes we need in the AOSP source for the face recognition, not in the Yocto.

 

616 Views
varshilg
Contributor II
Okay, great.
Are you only using pre-trained models, or are you building your own custom models from scratch? I’m asking because I am also deploying a model on the IMX and facing an issue where the Fully_Connected layers are not being converted to a Neuron Graph for the NPU.
0 Kudos
Reply
An error has occurred when reading existing sub-variable "Language_PG_Configuration"; see cause exception! The type of the containing value was: extended_hash+string (lithium.coreapi.webui.template.models.NamedValueByNameTemplateModel wrapped into f.e.b.StringModel) ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign redirect_lingo_page_url = web... [in template "language_macro_header.ftl" at line 173, column 1] - Reached through: #include "language_macro_header.ftl" [in template "Language_translator_Dashboard" at line 3, column 1] ----