Instructions to use bhavani037/depth-anything-v2-endpoint with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bhavani037/depth-anything-v2-endpoint with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("depth-estimation", model="bhavani037/depth-anything-v2-endpoint", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("bhavani037/depth-anything-v2-endpoint", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Depth-Anything-V2 custom endpoint handler
This repository holds a custom handler.py for Hugging Face Inference
Endpoints. HF's endpoint platform does not expose "Depth Estimation" as a
selectable task, so we serve depth-anything/Depth-Anything-V2-Small-hf through
a custom handler instead. The default PyTorch container auto-detects the
EndpointHandler class in handler.py and uses it to serve every request,
regardless of the configured task.
handler.pyโ loads Depth-Anything-V2 and returns{"depth": "<base64 PNG>", "width": W, "height": H}.requirements.txtโ extra dependencies installed on top of the base image.
The model weights are pulled at runtime from
depth-anything/Depth-Anything-V2-Small-hf, so this repo intentionally contains
no weights or config.json.
Deploy
Create a dedicated Inference Endpoint from this repo:
- Container Type: Default (auto-detects
handler.py) - Task: Custom
- Instance: smallest CPU
- Autoscaling: min replicas 0, Scale-to-zero (15 min)
- Security: Protected
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support