QuickSRNetMedium 示例
此文档讲述使用 QAI AppBuilder Python API 利用 Qualcomm® Hexagon™ Processor (NPU) 推理 QuickSRNetMedium 图像超分模型。
示例支持设备
| 设备 | SoC |
|---|---|
| Dragon Q6A | QCS6490 |
| Dragon Q8B | SC8280XP |
| Fogwise® AIRbox Q900 | QCS9075 |
安装 QAI AppBuilder
提示
-
请根据 QAI AppBuilder 安装方法 安装 QAI AppBuilder。
-
请根据 配置 QAIRT 环境变量 配置 QAIRT 环境变量。
运行示例
安装依赖
Device
pip3 install requests tqdm qai-hub py3_wget opencv-python torch torchvision matplotlib easyocr qai_hub_models transformers openai-clip
运行脚本
-
进入示例目录
- QCS6490
- SC8280XP
- QCS9075
Devicecd ai-engine-direct-helper/samples/linux/pythonDevicecd ai-engine-direct-helper/samples/linux/pythonDevicecd ai-engine-direct-helper/samples/python -
准备输入图片,这里以以下图片为输入示例

input image
-
执行推理
Devicepython3 quicksrnetmedium/quicksrnetmedium.py$ python3 quicksrnetmedium/quicksrnetmedium.py
Current file directory: /mnt/ssd/qualcomm/701/zzf_fork/ai-engine-direct-helper/samples/linux/python/quicksrnetmedium
Init
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.4.0/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
112.4ms [WARNING] Time: Read model file to memory. 0.12
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
118.0ms [WARNING] Time: contextCreateFromBinary. 5.51
118.0ms [WARNING] Time: UnmapViewOfFile. 0.00
118.3ms [WARNING] Time: model_initialize quicksrnetmedium 118.21
174.0ms [WARNING] Time: model_inference quicksrnetmedium 25.10
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.4.0/ipc/fastrpc/rpcmem/src/rpcmem_android.c:42:dummy call to rpcmem_deinit, rpcmem APIs will be used from libxdsprpc
353.0ms [WARNING] Time: model_destroy quicksrnetmedium 18.10
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening '/tmp/tmp751e_f48.PNG'
output image