Practical overview
When it fits
Use it when developing a Python image pipeline that needs monocular depth estimation and you want an ONNX export and ONNX Runtime inference workflow.
Who it is for
- Developers adding monocular depth estimation to image-processing applications
- Practitioners building Python inference pipelines around ONNX Runtime
- Users comparing model export options or working from pre-exported ONNX models
Documented uses
- Estimate depth from a single input image using an exported model.
- Export a Depth Anything V2 encoder to ONNX or a PyTorch 2 program.
- Use an existing ONNX model as a starting point for an image depth-estimation pipeline.
Requirements & limits
- The repository documents both model export and inference, and links pre-exported ONNX models for users who want to start from an existing model.
- Its standard export examples include opset selection and dynamic-shape options.
- The TorchDynamo export path is marked beta and currently supports only static shapes and opset 18.
- Published CUDA latency examples use an RTX 4080 12GB and report model-only timing, excluding preprocessing and other data-transfer or postprocessing costs.
- The repository lists an Apache-2.0 license.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Run inference with an exported ONNX model
Pass an image and an existing ONNX model to the repository's inference command.
Before you start
- Python environment with the repository requirements installed
- An exported ONNX model file, either downloaded from the repository's releases or created separately
- An image file
Steps
Install the repository requirements.
Obtain an exported ONNX model from the repository releases.
Run the command below, replacing the model and image paths with your files.
python dynamo.py infer weights/vitb.onnx -i assets/sacre_coeur1.jpg
Expected outcome
The CLI runs Depth Anything V2 inference through ONNX Runtime on the supplied image.
Guide limitations
- The example identifies ONNX Runtime and OpenCV as inference dependencies and does not require PyTorch for this inference path.
- The example command uses repository-specific file paths; adapt them to the locations of your model and image.
Export Depth Anything V2 to ONNX
Use the documented standard CLI command to export the ViT-B encoder as an ONNX model.
Before you start
- Python environment with the repository requirements installed
Steps
Install the repository requirements.
Run the command below.
python dynamo.py export --encoder vitb --output weights/vitb.onnx --opset 17
Expected outcome
The command requests a ViT-B ONNX export at the specified output path using opset 17.
Guide limitations
- The repository also documents a TorchDynamo exporter as beta; its current constraints are static shapes and opset version 18.
- The documented export command does not specify hardware requirements.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Depth Anything Onnx | Estimate depth from a single input image using an exported model. | Linux, Windows, macOS | |
| Esanet | Generate semantic labels from paired color and depth images. | Linux | The public repository states that its source code is licensed under Apache 2.0. |
| Ling V2 | Generate text from chat prompts using Ling-mini-2.0 and Transformers. | The repository is public and identifies the project as open source under the MIT license. Model downloads are linked through Hugging Face and ModelScope. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 November 2026
- Original website title
- fabio-sim/Depth-Anything-ONNX · Official homepage title · retained in its source language

