Forums - Can not use YUV(NV21) as input for snpe-2.12 nn models

1 post / 0 new
Can not use YUV(NV21) as input for snpe-2.12 nn models
qiyafei.7
Join Date: 4 Nov 21
Posts: 1
Posted: Thu, 2024-02-01 05:23

Hi,

I am currently facing an issue while attempting to use the Android camera frame directly as input for the SNPE engine. I have followed the steps outlined below:

  1. Converted ONNX into a DLC model using snpe-onnx-to-dlc:

snpe-onnx-to-dlc --no_simplification -i deploy.onnx -o deploy_yuv.dlc --input_encoding "data" nv21 bgr
  1. Quantized the DLC model using snpe-dlc-quantize:

snpe-dlc-quantize --input_dlc deploy_yuv.dlc --input_list image.list --output_dlc deploy_yuv_quantized.dlc

The calibration images in image.list are converted into nv21 format

  1. Run the model on device

    the code is following SampleCode, we set SNPEBuilder with setRuntimeProcessorOrder with Runtime_t::DSP and Runtime_t::CPU, and we set "unsignedPD:ON"

However, when using the quantized DLC in YUV format, the following error is encountered:

build engine error: error_code=401; error_message=Network creation has failed. QnnGraph_finalize failed: 1002; error_component=Dl Network; line_no=2196; thread_id=544263146752; error_component=Dl Network; line_no=283; thread_id=544290178296 loadmodel_withdecrypt fail! ret=-1

The device is QCM5430, and the SNPE version is 2.12.0.230626.

However,the quantized DLC in BGR format runs successfully, and the result is correct. Any guidance on how to use YUV as input directly would be greatly appreciated.

Many thanks for your help!!

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.