ByteDance-Seed / ByteDance-Seed/Depth-Anything-3

Proposal to Improve DepthAnything3 API Design for Better Usability and Integration Experience

Open
#187 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
6.3k
Forks
702
PR merge metrics
No merged PRs in 30d

Description

## 🛠 Proposal to Improve DepthAnything3 API Design for Better Usability and Integration Experience

### Background
Hello, team! Currently, when using the DepthAnything3 model, users need to manually handle device allocation, model loading, and inference pipelines, which makes the code relatively cumbersome. In the Hugging Face ecosystem, many models (such as DINOv2) provide advanced interfaces like `pipeline` or `AutoModel`, greatly simplifying the calling process.

### Current Example
```python
import torch
from depth_anything_3.api import DepthAnything3

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model = DepthAnything3.from_pretrained("depth-anything/da3-base")
model = model.to(device=device)

images = ["image1.jpg", "image2.jpg"]
prediction = model.inference(
images,
export_dir="output",
export_format="glb"
)
```

### Suggested Improvement
We hope to refer to Hugging Face's API design to provide a more concise and consistent calling method, for example:

```python
from depth_anything_3 import pipeline

pipe = pipeline(task="depth-estimation", model="depth-anything/da3-base")
results = pipe(["image1.jpg", "image2.jpg"], export_dir="output", export_format="glb")
```

Or at least provide an `AutoModel`-like wrapper that supports automatic device allocation, model configuration, and preprocessing.

### Advantages
1. **Lower the barrier to entry**: Reduce boilerplate code users need to write, especially suitable for rapid experimentation and integration into other systems.
2. **Maintain consistency**: Align with the API style of the Hugging Face ecosystem, making it easier for developers familiar with that ecosystem to use seamlessly.
3. **Facilitate extension**: In the future, it could support more tasks (such as depth completion, confidence calibration, etc.) through pipeline-style calls.
4. **Suitable for embedded applications like robotics**: Simplified code makes it easier to integrate into practical systems such as robot base models.

### Additional Context
Our team plans to use this model in robotic vision systems. Providing a more concise API would significantly improve development efficiency and code maintainability.

Thank you for your hard work and dedication. We look forward to your feedback and improvements!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the current depth_anything_3.api.DepthAnything3 usage shown in the issue, including from_pretrained, device handling, and inference. Compare those entry points with the proposed pipeline and AutoModel-style interfaces. Done should mean the team has defined a concrete API scope, supported behaviors, and acceptance criteria for simplified loading and inference.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, python
Domain
api, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.