DAV2SW
Depth Anything V2 for browser execution
2 min readupdated
This repository contains a compact version of the Depth Anything V2 Small model, repackaged to run directly in the user's web browser using ONNX Runtime Web. The original weights are converted to 16-bit floating-point numbers (FP16), cutting the download file size in half without losing quality. All calculations run locally on the user's device, so uploaded photos never leave the device. This model is useful for frontend developers and interactive web app creators who need client-side image depth estimation.
Key features
- Browser execution: the model is optimized to run via ONNX Runtime Web directly on the visitor's device.
- Reduced size: weights are saved in FP16 format instead of the standard 32-bit, speeding up page loading.
- Flexible size: the ONNX graph is exported with a dynamic image size, and positions are passed as a separate input.
- Accuracy: the maximum depth difference compared to the authors' original code is no more than 0.0094 of the image range.
What you can do
- Interactive web services: embed photo depth estimation into a web application without sending data to a server.
- Local processing: implement background blur and focus transition effects in the browser.
- ONNX experiments: use the prepared graph parts and weights to study client-side inference.
Example
To run the model in the browser, you need to connect the weight files, prepare the input image tensor according to ImageNet standards, and pass the data to the ONNX graph along with the position matrix.
Read more
DetailsArchitecture: Depth Anything V2 Small (commit a561b849)
File format: separated ONNX graphs, weights split into 5 binary streams
License: Apache 2.0 (same as the base Small version)




![FLUX.2 [klein] 9B LoRA Mirror](/media/hub-sarrasin--loras-flux2-klein-9b-detail-slider/cover-320.webp)
![FLUX.2 [klein] 9B LoRA Mirror](/media/hub-sarrasin--loras-flux2-klein-9b-detail-slider/cover.webp)


Comments