Skip to main content

NPU Quick Validation

This document provides an out-of-the-box resnet50 object recognition model inference example. This example performs hardware-accelerated inference using Qualcomm® Hexagon™ Processor (NPU) on Radxa Dragon Ubuntu system.

tip

Before performing NPU Quick Verification, please refer to Enable NPU on Board to make sure the NPU is enabled.

Download Example​

Device
pip3 install modelscope
modelscope download --model radxa/resnet50_qairt --local ./resnet50_qairt

Run Example​

Please import environment variables according to SoC

Device
export PRODUCT_SOC=8280

Execute model inference

Device
cd resnet50_qairt/${PRODUCT_SOC}
chmod +x qnn-net-run
./qnn-net-run --backend ./libQnnHtp.so --retrieve_context ./resnet50_aimet_quantized_${PRODUCT_SOC}.bin --input_list ./test_list.txt --output_dir output_bin

Verify Example​

You can use python script for result verification

Device
cd ../scripts
python3 show_resnet50_classifications.py --input_list ../${PRODUCT_SOC}/test_list.txt -o ../${PRODUCT_SOC}/output_bin/ --labels_file ../data/imagenet_classes.txt
$ python3 show_resnet50_classifications.py --input_list ../${PRODUCT_SOC}/test_list.txt -o ../${PRODUCT_SOC}/output_bin/ --labels_file ../data/imagenet_classes.txt
Classification results
../data/test/crop/ILSVRC2012_val_00003441.raw 21.476509 402 acoustic guitar
../data/test/crop/ILSVRC2012_val_00008465.raw 22.651005 927 trifle
../data/test/crop/ILSVRC2012_val_00010218.raw 12.248322 281 tabby
../data/test/crop/ILSVRC2012_val_00044076.raw 18.456375 376 proboscis monkey

By comparing the printed results with the test image content, you can confirm that the output results of the resnet50 model ported to Qualcomm® NPU are correct.

resnet50 input images

    You need to be logged into GitHub to post a comment. If you are already logged in, please ignore this message.

    Radxa-docs © 2026 by Radxa Computer (Shenzhen) Co.,Ltd. is licensed under CC BY 4.0