Distill Any Depth Large hf

Providerxingyang1
Categorydepth-estimation
Licensemit
Downloads201.6K
Stars0

Overview

Distill Any Depth Large is a specialized depth-estimation model designed for high-fidelity spatial mapping from single-image inputs. Unlike general-purpose vision models, this distilled version optimizes the trade-off between inference speed and depth accuracy, making it suitable for real-time applications where latency is critical. Developers can integrate this into pipelines for AR/VR spatial anchoring, autonomous navigation, or computational photography. Compared to larger foundation models, it offers a smaller memory footprint while maintaining competitive edge-definition and relative depth consistency, simplifying deployment on edge devices or resource-constrained cloud environments.

Highlights

  • High-precision single-image depth estimation
  • Optimized inference speed for real-time applications
  • Reduced memory overhead via model distillation
  • Seamless integration for AR and robotics pipelines
  • Permissive MIT license for commercial deployment

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("xingyang1/Distill-Any-Depth-Large-hf")
tokenizer = AutoTokenizer.from_pretrained("xingyang1/Distill-Any-Depth-Large-hf")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download xingyang1/Distill-Any-Depth-Large-hf

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download xingyang1/Distill-Any-Depth-Large-hf config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('xingyang1/Distill-Any-Depth-Large-hf')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/xingyang1/Distill-Any-Depth-Large-hf

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/xingyang1/Distill-Any-Depth-Large-hf

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('xingyang1/Distill-Any-Depth-Large-hf')
tokenizer = AutoTokenizer.from_pretrained('xingyang1/Distill-Any-Depth-Large-hf')

Full Documentation

来源: HuggingFace

---
library_name: transformers
license: mit
pipeline_tag: depth-estimation
arxiv: <2502.19204>
tags:

  • distill-any-depth

  • vision

---

Distill Any Depth Large - Transformers Version

Introduction

We present Distill-Any-Depth, a new SOTA monocular depth estimation model trained with our proposed knowledge distillation algorithms. It was introduced in the paper Distill Any Depth: Distillation Creates a Stronger Monocular Depth Estimator.

This model checkpoint is compatible with the transformers library.

Online demo.

How to use

Here is how to use this model to perform zero-shot depth estimation:

python
from transformers import pipeline
from PIL import Image
import requests

load pipe

pipe = pipeline(task="depth-estimation", model="xingyang1/Distill-Any-Depth-Large-hf")

load image

url = 'http://images.cocodataset.org/val2017/000000039769.jpg' image = Image.open(requests.get(url, stream=True).raw)

inference

depth = pipe(image)["depth"]

Alternatively, you can use the model and processor classes:

python
from transformers import AutoImageProcessor, AutoModelForDepthEstimation
import torch
import numpy as np
from PIL import Image
import requests

url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)

image_processor = AutoImageProcessor.from_pretrained("xingyang1/Distill-Any-Depth-Large-hf")
model = AutoModelForDepthEstimation.from_pretrained("xingyang1/Distill-Any-Depth-Large-hf")

prepare image for the model

inputs = image_processor(images=image, return_tensors="pt")

with torch.no_grad():
outputs = model(**inputs)

interpolate to original size and visualize the prediction

post_processed_output = image_processor.post_process_depth_estimation( outputs, target_sizes=[(image.height, image.width)], )

predicted_depth = post_processed_output[0]["predicted_depth"]
depth = (predicted_depth - predicted_depth.min()) / (predicted_depth.max() - predicted_depth.min())
depth = depth.detach().cpu().numpy() * 255
depth = Image.fromarray(depth.astype("uint8"))
)

If you find this project useful, please consider citing:

bibtex
@article{he2025distill,
  title   = {Distill Any Depth: Distillation Creates a Stronger Monocular Depth Estimator},
  author  = {Xiankang He and Dongyan Guo and Hongji Li and Ruibo Li and Ying Cui and Chi Zhang},
  year    = {2025},
  journal = {arXiv preprint arXiv: 2502.19204}
}

Model Card Author

Parteek Kamboj
Join our Telegram