Skip to content

Qualcomm AI Engine Direct - Add depth_anything_v2_small to oss_scripts#18657

Open
zhaoxul-qti wants to merge 1 commit intopytorch:mainfrom
CodeLinaro:dev1/zhaoxul/add_depth_anything_v2_small_to_oss_scripts
Open

Qualcomm AI Engine Direct - Add depth_anything_v2_small to oss_scripts#18657
zhaoxul-qti wants to merge 1 commit intopytorch:mainfrom
CodeLinaro:dev1/zhaoxul/add_depth_anything_v2_small_to_oss_scripts

Conversation

@zhaoxul-qti
Copy link
Copy Markdown

Summary

  • Enable depth_anything_v2_small model (https://github.com/DepthAnything/Depth-Anything-V2) on HTP and integrates the script into oss_scripts/.
  • Provide --dump_example_output flag to dump the example image and export depth‑estimation images from both source model and QNN outputs.
  • Add unit tests to cover the added model.

Notes

  • SQNR is used for matrix evaluation as it provides a more intuitive comparison for our use case compared to AbsRel or RMSE referenced in the paper.
  • The model accepts input images of arbitrary resolutions. For evaluation, we use ImageNet samples, rather than the dataset cited in the original publication.

Constraints

  • The model is currently unsupported on GPU backend due to the unsupported cubic mode of Resize op.
  • GPU support will be enabled once constant folding is introduced, allowing the cubic Resize op to be eliminated.

Test plan

  • Test with random images from ImageNet:
    python examples/qualcomm/oss_scripts/depthanything_v2_small.py -a $ARTIFACT -d $IMAGENET_FOLDER_PATH -b build-android/ -H $HOST_NAME -s $DEVICE_ID -m $SOC_ID --seed 1126

  • Test with the example image and export the post-processed source model output and QNN output into depth-estimation images:
    python examples/qualcomm/oss_scripts/depthanything_v2_small.py -a $ARTIFACT -d $IMAGENET_FOLDER_PATH -b build-android/ -H $HOST_NAME -s $DEVICE_ID -m $SOC_ID --dump_example_output

Results

Example Image:
source

Source Model Output (with depth-estimation post-processing):
golden_depth

QNN-HTP Output (with depth-estimation post-processing):
prediction_depth

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.