Skip to content
ModelVerifiedExternal
Download

Depth Anything v2 Small

with ONNX weights to be compatible with Transformers.js.

KindOtherBase modeldepth-anything/Depth-Anything-V2-SmallVersionRevision 4a2138cPublisher@FreeHugsForRobotsCgrade

Model source

Kind
Other
File size
18.2–94.5 MB
Base model
depth-anything/Depth-Anything-V2-Small
Version
vRevision 4a2138c
Updated
Oct 3, 2026
Downloads
12
Source
Hugging Face

Source description

https://huggingface.co/depth-anything/Depth-Anything-V2-Small with ONNX weights to be compatible with Transformers.js.

Usage (Transformers.js)

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Example: Depth estimation w/ onnx-community/depth-anything-v2-small.

import { pipeline } from '@huggingface/transformers';

// Create depth estimation pipeline
const depth_estimator = await pipeline('depth-estimation', 'onnx-community/depth-anything-v2-small');

// Predict depth of an image
const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
const { depth } = await depth_estimator(url);

// Visualize the output
depth.save('depth.png');

image/png


Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using 🤗 Optimum and structuring your repo like this one (with ONNX weights located in a subfolder named onnx).

Sources

1 source
Hugging FacePrimaryVersion 4a2138c9f42fae87fdfb1a4a69193951d14ecd45
huggingface.co/FreeHugsForRobots/depth-anything-v2-small/tree/4a2138c9f42fae87fdfb1a4a69193951d14ecd45

Verified Oct 3

Model artifacts

8 artifacts

onnx/model_bnb4.onnx

onnx · 24.9 MB · SHA-256 0312c94ffd25…4185 · Hugging Face

Download

onnx/model_fp16.onnx

onnx · 47.3 MB · SHA-256 2df6223f206b…5b04 · Hugging Face

Download

onnx/model_int8.onnx

onnx · 26.0 MB · SHA-256 01aa7a23de3f…9001 · Hugging Face

Download

onnx/model_q4.onnx

onnx · 26.1 MB · SHA-256 5d55b02762e1…fcf8 · Hugging Face

Download

onnx/model_q4f16.onnx

onnx · 18.2 MB · SHA-256 eca72971aea6…bf1e · Hugging Face

Download

onnx/model_quantized.onnx

onnx · 26.0 MB · SHA-256 fcf51f1b2303…f20d · Hugging Face

Download

onnx/model_uint8.onnx

onnx · 26.0 MB · SHA-256 fcf51f1b2303…f20d · Hugging Face

Download

onnx/model.onnx

onnx · 94.5 MB · SHA-256 afb6a5c28f3b…f10c · Hugging Face

Download

Source excerpts

3 excerpts

--- base_model: depth-anything/Depth-Anything-V2-Small library_name: transformers.js license: apache-2.0 pipeline_tag: depth-estimation new_version: onnx-community/depth-anything-v2-small-ONNX --- https://huggingface.co/depth-anything/Depth-Anything-V2-Small with ONNX weights to be compatible with Transformers.js. ## Usage (Transformers.js) If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using: ```bash npm i @huggingface/transformers ``` **Example:** Depth estimation w/ `onnx-community/depth-anything-v2-small`. ```js import { pipeline } from '@huggingface/transformers'; // Create depth estimation pipeline const depth_estimator = await pipeline('depth-estimation', 'onnx-community/depth-anything-v2-small'); // Predict depth of an image const url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg'; const { depth } = await depth_estimator(url); // Visualize the output depth.save('depth.png'); ``` ![image/png](https://cdn-uploads.huggingface.co/production/uploads/61b253b7ac5ecaae3d1efe0c/vfxg_YtHfvna4gZBOCRgD.png) --- Note: Having a separate repo for ONNX weights is intended to be a temporary solution until WebML gains more traction. If you would like to make your models web-ready, we recommend converting to ONNX using [🤗 Optimum](https://huggingface.co/docs/optimum/index) and structuring your repo like this one (with ONNX weights located in a subfolder named `onnx`).

Source context: 12 downloads · 0 likes · Pipeline depth-estimation · Library transformers.js · Repo FreeHugsForRobots/depth-anything-v2-small

Source context: 21 downloads · 0 likes · Pipeline depth-estimation · Library transformers.js · Repo FreeHugsForRobots/depth-anything-v2-small