ai-hub-models
ai-hub-models copied to clipboard
Using NPU in ImageClassification demo app
I am attempting to use the image classification Android app to verify NPU usage with the tflite runtime. I am using a phone with the Snapdragon 8 Gen 3 chipset.
When running the app, the execution time for CPU and NPU (after a few executions of each) settle at around the same, ~14ms compared to the reported NPU execution time of <1ms. Is there any way to debug this or verify whether the tflite runtime is using the NPU?
I have tried both downloading the MobileNet-v3-Small model from aihub and using the this export script. I have also tried installing the app with the provided build_apk.py
script and using Android Studio, after manually copying the tflite model to assets
. In each case the result is the same.
When I try the app on a phone without an NPU, it crashes while trying to register the HTP backend. This leads me to believe the HTP backend is being registered correctly for the Gen 3 phone.