> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/deploy/supported-models/depth-anything-v2.md).

# Depth Anything V2

Depth Anything V2 एक मोनोक्युलर डेप्थ एस्टिमेशन मॉडल है। यह किसी भी इनपुट इमेज के लिए एक नॉर्मलाइज़्ड डेप्थ मैप (0 और 1 के बीच के मान) लौटाता है।

{% hint style="info" %}
Depth Anything V2 Serverless Hosted API पर उपलब्ध नहीं है। इसे एक [Dedicated Deployment](/roboflow/roboflow-hi/deploy/dedicated-deployments.md) या [self-hosted Inference](https://inference.roboflow.com/).
{% endhint %}

## कोड उदाहरण

इंस्टॉल करें [Inference SDK](https://inference.roboflow.com/):

```bash
pip install inference-sdk opencv-python
```

सेट करें `api_url` अपने Dedicated Deployment URL या किसी local Inference server पर। अपना [Roboflow API Key](https://app.roboflow.com/settings/api) के माध्यम से `API_KEY` environment variable. यह script डेप्थ मैप को रंगीन बनाता है और इनपुट के साथ side-by-side comparison लिखता है।

```python
import os
import urllib.request

import cv2
import numpy as np
from inference_sdk import InferenceHTTPClient

IMAGE_URL = "https://storage.googleapis.com/com-roboflow-marketing/notebooks/examples/bicycle.png"
IMAGE_PATH = "bicycle.png"
OUTPUT_PATH = "depth_annotated.png"

urllib.request.urlretrieve(IMAGE_URL, IMAGE_PATH)
image = cv2.imread(IMAGE_PATH)

client = InferenceHTTPClient(
    api_url="https://your-deployment.roboflow.cloud",
    api_key=os.getenv("API_KEY"),
)
result = client.depth_estimation(IMAGE_PATH)

depth = np.array(result["normalized_depth"], dtype=np.float32)
depth = cv2.resize(depth, (image.shape[1], image.shape[0]))
depth_vis = (depth * 255).astype(np.uint8)
depth_color = cv2.applyColorMap(depth_vis, cv2.COLORMAP_INFERNO)

cv2.imwrite(OUTPUT_PATH, np.hstack([image, depth_color]))
```

<figure><img src="/files/860e023a10ee808611487ad9ad6a1b978bd52fe2" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
सेट करें `api_url` को अपने deployment target से मिलाने के लिए:

* `http://localhost:9001` एक स्थानीय [Inference](https://inference.roboflow.com/) सर्वर।
* आपका [Dedicated Deployment](/roboflow/roboflow-hi/deploy/dedicated-deployments.md) एक private endpoint के लिए URL।
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-hi/deploy/supported-models/depth-anything-v2.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
