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
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support