Running Depth Anything model on Qualcomm SNPE SDK.
We will be using Depth-Anything-ONNX to generate ONNX weight files of the model.
# clone into Depth-Anything-ONNX
conda create -n dav2 python=3.11
conda activate dav2
pip install -r requirements.txt
python dynamo.py export --encoder vits -o depth_anything_vits_op16.onnx -b 1 --opset 16
This step assumes you have installed SNPE SDK successfully. You should see the following message if sourced correctly.
[INFO] AISW SDK environment set
[INFO] QNN_SDK_ROOT: /mnt/d/Downloads_F/v2.22.6.240515/qairt/2.22.6.240515
[INFO] SNPE_ROOT: /mnt/d/Downloads_F/v2.22.6.240515/qairt/2.22.6.240515
SDK environment now set up; additionally you may now run devtool to perform development tasks.
Run devtool --help for further details.
# clone the repository
conda create -f environment_snpe.yml
conda activate snpe
snpe-onnx-to-dlc --input_network assets/onnx/depth_anything_vits_op16.onnx -o assets/dlc/depth_anything_vits_op16.dlc
snpe-net-run --container assets/dlc/depth_anything_vits_op16.dlc --input_list assets/input_list.txt
A successful run should give the following output
-------------------------------------------------------------------------------
Model String: N/A
SNPE v2.22.6.240515184619_92920
-------------------------------------------------------------------------------
Processing graph : depth_anything_vits_op16
Processing DNN input(s):
./input/input.raw
Processing DNN input(s):
./input/input2.raw
Successfully executed graph depth_anything_vits_op16
Refer to OPTIMIZATION.md for further improving the performance of the DLC model.