Who is this for?

This Learning Path is for Android and machine learning developers who want to run monocular depth estimation locally on an Arm-based Android phone.

What will you learn?

Upon completion of this Learning Path, you will be able to:

  • Prepare the Android command-line tools and connect an Arm-based Android phone.
  • Download and run the Depth Anything V2 Small INT8 ExecuTorch model from the Arm AI Portal.
  • Inspect the model's fixed image preprocessing and relative-disparity output.
  • Validate input-dependent relative-disparity maps across two images.

Prerequisites

Before starting, you will need the following:

  • A macOS, x86_64 Linux, or Windows development computer with Git, Python 3 with venv and pip, and JDK 17 or later
  • An Arm-based Android phone running Android 9 or later
  • A Hugging Face account if the model repository requires authentication
  • A data-capable USB cable
  • Homebrew on macOS, curl on Linux, or winget on Windows to install Android CLI
  • Network access for the first Gradle build and model download
  • Basic familiarity with terminal commands and Android applications

Summary

AI-assisted

This summary was drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
You’ll prepare Android command-line tools, connect an Arm-based Android phone, and build and install an application called Image Analysis. You’ll then download the Arm-optimized Depth Anything V2 Small INT8 ExecuTorch model and copy it into application-private storage. Finally, you’ll run on-device depth estimation and inspect the adapter’s preprocessing and tensor contract. By comparing relative-disparity maps from two images, you’ll confirm that the output changes with the input.

Frequently asked questions

AI-assisted

These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.

Close
?
How do I know if my phone is detected?
Run adb devices -l and confirm that your phone is listed as device. If you see unauthorized, unlock your phone and accept the debugging prompt. On Windows, you might also need the manufacturer’s USB driver.
Where should I place the downloaded model file so that the app can load it?
Download depth_anything_v2_small_executorch_optimized.pte into model/$MODEL_ID. Then, use adb push to copy it through /data/local/tmp and run-as to place it at files/models/$MODEL_ID/$MODEL_FILE in application-private storage. Verify the destination with run-as ... ls -l, then remove the temporary device copy.
How do I start the app from the command line and pick the correct model?
Run adb shell am start -n com.arm.learningpath.imagetoimage/.ui.MainActivity. In the app, select Depth Anything V2 Small INT8, select Load model, choose a JPEG or PNG image, and then select Run depth estimation.
What should I expect while the model loads or runs inference?
You’ll see that the model and image controls become unavailable while the app decodes the image, loads the model, or runs inference. The controls become available again when the operation finishes or reports an error. After inference, you’ll see a grayscale relative-disparity map and the model load and inference times.
How do I validate results across two inputs?
Run two different images and confirm that both runs finish without errors, each disparity range contains finite values, and the maps differ. Check that nearer regions appear brighter than farther regions and that each result aligns with its decoded image preview.
Next