---
title: Depth-Anything-V2-Small
canonical_url: "https://www.modelscope.cn/models/depth-anything/Depth-Anything-V2-Small"
md_url: "https://www.modelscope.cn/models/depth-anything/Depth-Anything-V2-Small.md"
repository: depth-anything/Depth-Anything-V2-Small
last_updated: 2025-02-10
license: apache-2.0
library_name:
  - pytorch
frameworks:
  - pytorch
language:
  - en
downloads: 1397
stars: 2
tags:
  - depth
  - "relative depth"
---

# Depth-Anything-V2-Small

> Depth-Anything-V2-Small - depth-anything 在 ModelScope 开源的模型。Depth-Anything-V2-Small

depth-anything/Depth-Anything-V2-Small 是 ModelScope 魔搭社区上的机器学习模型，采用 apache-2.0 许可。

- **Repository**: depth-anything/Depth-Anything-V2-Small
- **License**: apache-2.0
- **Tags**: depth, relative depth
- **Downloads**: 1397
- **Stars**: 2
- **Last updated**: 2025-02-10

Source: https://www.modelscope.cn/models/depth-anything/Depth-Anything-V2-Small

---

# Depth-Anything-V2-Small

## Introduction
Depth Anything V2 is trained from 595K synthetic labeled images and 62M+ real unlabeled images, providing the most capable monocular depth estimation (MDE) model with the following features:
- more fine-grained details than Depth Anything V1
- more robust than Depth Anything V1 and SD-based models (e.g., Marigold, Geowizard)
- more efficient (10x faster) and more lightweight than SD-based models
- impressive fine-tuned performance with our pre-trained models

## Installation

```bash
git clone https://huggingface.co/spaces/depth-anything/Depth-Anything-V2
cd Depth-Anything-V2
pip install -r requirements.txt
```

## Usage

Download the [model](https://huggingface.co/depth-anything/Depth-Anything-V2-Small/resolve/main/depth_anything_v2_vits.pth?download=true) first and put it under the `checkpoints` directory.

```python
import cv2
import torch

from depth_anything_v2.dpt import DepthAnythingV2

model = DepthAnythingV2(encoder='vits', features=64, out_channels=[48, 96, 192, 384])
model.load_state_dict(torch.load('checkpoints/depth_anything_v2_vits.pth', map_location='cpu'))
model.eval()

raw_img = cv2.imread('your/image/path')
depth = model.infer_image(raw_img) # HxW raw depth map
```

## Citation

If you find this project useful, please consider citing:

```bibtex
@article{depth_anything_v2,
  title={Depth Anything V2},
  author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Zhao, Zhen and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
  journal={arXiv:2406.09414},
  year={2024}
}

@inproceedings{depth_anything_v1,
  title={Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data}, 
  author={Yang, Lihe and Kang, Bingyi and Huang, Zilong and Xu, Xiaogang and Feng, Jiashi and Zhao, Hengshuang},
  booktitle={CVPR},
  year={2024}
}
