Inception v3 Example
This document explains how to use the QAI AppBuilder Python library to run the Inception-v3 object detection model on the Radxa Dragon Q6A.
Install QAI AppBuilder
tip
Please follow the QAI AppBuilder Installation Guide
Run the Example
Install Dependencies
Device
pip3 install requests tqdm qai-hub py3_wget opencv-python torch
Run the Script
-
Navigate to the example directory
Devicecd ai-engine-direct-helper/samples/linux/python
-
Prepare the input image. The following image is used as an example:
Input Image
-
Execute the inference
Devicepython3 inception_v3/inception_v3.py --image ./inception_v3/input.jpg
(.venv) ubuntu@ubuntu:~/git_clone/ai-engine-direct-helper/samples/linux/python$ python3 inception_v3/inception_v3.py --image ./inception_v3/input.jpg
Current file directory: /home/ubuntu/git_clone/ai-engine-direct-helper/samples/linux/python/inception_v3
model_path: /home/ubuntu/git_clone/ai-engine-direct-helper/samples/linux/python/inception_v3/models/inception_v3.bin
/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.4.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:38:dummy call to rpcmem_init, rpcmem APIs will be used from libxdsprpc
Top 5 predictions for image:
goldfish 0.9550418258
rock beauty 0.0439209454
anemone fish 0.0008165489
puffer 0.000045009
ambulance 0.0000313302
/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.4.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:42:dummy call to rpcmem_deinit, rpcmem APIs will be used from libxdsprpc
902.9ms [WARNING] Time: model_destroy inceptionV3 17.96
The output shows that goldfish
has the highest confidence score, which matches the content of the input image.