quic / ai-hub-models

The Qualcomm® AI Hub Models are a collection of state-of-the-art machine learning models optimized for performance (latency, memory etc.) and ready to deploy on Qualcomm® devices.
https://aihub.qualcomm.com
BSD 3-Clause "New" or "Revised" License
338 stars 45 forks source link

Image_Classification apk is crashed after device runtime is selected #36

Open axcpy08 opened 2 months ago

axcpy08 commented 2 months ago

Describe the bug Follow the instruction in "apps/android/ImageClassification" and classification-debug.apk is built successfully. Installed the apk on Samsung Galaxy S21 Ultra. Sample image can be selected and it will be displayed on UI. After selecting CPU or NPU runtime, Image_Classification app is crashed.

Question I only have Samsung Galaxy S21 Ultra now and I can't test this apk on others phone. Is this example app only limited to certain chipsets? I saw GPU is used not NPU with python -m qai_hub_models.models.mobilenet_v3_small.export --device "Samsung Galaxy S21 Ultra". Any changes need to be done for this case? Thank you.

bhushan23 commented 2 months ago

Hi @axcpy08 this model should work on CPU as well e.g. you can quickly verify this with

python -m qai_hub_models.models.mobilenet_v3_small.export --device "Samsung Galaxy S21 Ultra" --profile-options "--
compute_unit cpu"

How are you providing compute_unit as CPU/NPU within the app? selecting GPU as a compute unit should run this on TFLite GPU path.