Skip to content

Feature Request: Add Hugging Face Transformers Pipeline Support for DA3 Models #182

@agn-7

Description

@agn-7

🚀 Feature Request

Is your feature request related to a problem? Please describe.

Currently, Depth Anything V3 models require custom installation and usage through the depth_anything_3 package. While this works well, it creates friction for users who are already using the Hugging Face Transformers ecosystem and would like to seamlessly integrate DA3 models into their existing workflows.

Unlike Depth Anything V2 models (which work via transformers.pipeline), DA3 models are not yet integrated into the Transformers library, requiring users to maintain separate codebases and dependencies.

Example of current limitation:

# This works for V2 ✅
from transformers import pipeline
pipe = pipeline(task='depth-estimation', model='depth-anything/Depth-Anything-V2-Small-hf')
depth = pipe(image)

# This fails for V3 ❌
pipe = pipeline(task='depth-estimation', model='depth-anything/DA3-BASE')
# ValueError: Unrecognized model in depth-anything/DA3-BASE

Describe the solution you'd like

Add official support for DA3 models in the Hugging Face Transformers library, enabling users to:

  1. Use the standard pipeline API for depth estimation with DA3 models
  2. Seamlessly switch between V2 and V3 models without changing code structure
  3. Leverage existing Transformers features like automatic model caching, device mapping, and preprocessing

Desired API:

from transformers import pipeline

# Should work seamlessly
pipe = pipeline(
    task='depth-estimation',
    model='depth-anything/DA3-BASE',
    device='mps'  # or 'cuda', 'cpu'
)

result = pipe(image)
depth_map = result['depth']

Describe alternatives you've considered

Current workaround:

from depth_anything_3.api import DepthAnything3
model = DepthAnything3.from_pretrained('depth-anything/DA3-BASE')
prediction = model.inference([image])

While this works, it requires:

  • Separate installation (pip install -e . from GitHub)
  • Different API/code patterns
  • Manual device management
  • Breaking changes when migrating from V2 to V3

Benefits

Adding Transformers support would:

  1. Improve adoption - Lower barrier to entry for existing Transformers users
  2. Standardize usage - Consistent API across depth estimation models
  3. Enable comparison - Easy A/B testing between V2 and V3
  4. Leverage ecosystem - Automatic benefits from Transformers improvements
  5. Simplify deployment - Standard model serving patterns (e.g., inference endpoints)

Additional context

  • Models are already on Hugging Face Hub: https://huggingface.co/depth-anything/DA3-BASE
  • License is Apache 2.0: Compatible with commercial use
  • V2 integration exists: Proven pattern for depth estimation in Transformers
  • Use case: Building production applications that need to support both V2 and V3 with minimal code changes

Environment

  • OS: macOS (Apple Silicon M3)
  • Python: 3.13
  • Transformers: 4.x
  • Use case: Interior design visualization pipeline

Would you be willing to contribute?

I'd be happy to help test the integration or provide feedback during development.

References


Thank you for developing Depth Anything V3! The improvements over V2 are impressive, and Transformers integration would make it even more accessible to the community. 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions