Inception v3 Example
This document describes how to use the QAI AppBuilder Python API to run inference with the Inception-v3 object recognition model on Qualcomm® Hexagon™ Processor (NPU).
Supported Devices
| Device | SoC |
|---|---|
| Dragon Q6A | QCS6490 |
| Dragon Q8B | SC8280XP |
| Fogwise® AIRbox Q900 | QCS9075 |
Install QAI AppBuilder
tip
-
Please install QAI AppBuilder according to QAI AppBuilder Installation Guide.
-
Please configure ADSP environment variables according to Create ADSP Environment Variables.
Run the Example
Install Dependencies
Device
pip3 install requests tqdm qai-hub py3_wget opencv-python torch torchvision
Run the Script
- Navigate to the example directory
- QCS6490
- SC8280XP
- QCS9075
Device
cd ai-engine-direct-helper/samples/linux/python
Device
cd ai-engine-direct-helper/samples/linux/python
Device
cd ai-engine-direct-helper/samples/python
-
Prepare input image. The following image is used as an example:

input image
-
Run inference
Devicepython3 inception_v3/inception_v3.py --image ./inception_v3/input.jpg$ python3 inception_v3/inception_v3.py --image ./inception_v3/input.jpg
0.0ms [WARNING] <W> Initializing HtpProvider
/prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.37.1/point_release/SNPE_SRC/avante-tools/prebuilt/dsp/hexagon-sdk-5.5.5/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
221.6ms [WARNING] Time: Read model file to memory. 17.28
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
258.5ms [WARNING] Time: contextCreateFromBinary. 36.82
258.5ms [WARNING] Time: UnmapViewOfFile. 0.00
260.2ms [WARNING] Time: model_initialize inceptionV3 260.14
332.1ms [WARNING] Time: model_inference inceptionV3 3.50
Top 5 predictions for image:
Samoyed 0.9998983145
Arctic fox 0.000054331
white wolf 0.0000345349
Eskimo dog 0.0000035142
Pomeranian 0.0000030651
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
0.0ms [WARNING] <W> This META does not have Alloc2 Support
/prj/qct/webtech_scratch20/mlg_user_admin/qaisw_source_repo/rel/qairt-2.37.1/point_release/SNPE_SRC/avante-tools/prebuilt/dsp/hexagon-sdk-5.5.5/ipc/fastrpc/rpcmem/src/rpcmem_android.c:42:dummy call to rpcmem_deinit, rpcmem APIs will be used from libxdsprpc
443.3ms [WARNING] Time: model_destroy inceptionV3 105.74The output shows that
Samoyedhas the highest confidence score, which matches the content of the input image.