-
Notifications
You must be signed in to change notification settings - Fork 338
Description
🚀 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-BASEDescribe the solution you'd like
Add official support for DA3 models in the Hugging Face Transformers library, enabling users to:
- Use the standard
pipelineAPI for depth estimation with DA3 models - Seamlessly switch between V2 and V3 models without changing code structure
- 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:
- ✅ Improve adoption - Lower barrier to entry for existing Transformers users
- ✅ Standardize usage - Consistent API across depth estimation models
- ✅ Enable comparison - Easy A/B testing between V2 and V3
- ✅ Leverage ecosystem - Automatic benefits from Transformers improvements
- ✅ 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
- Depth Anything V2 (working example): https://huggingface.co/depth-anything/Depth-Anything-V2-Small-hf
- DA3 Model Hub: https://huggingface.co/depth-anything/DA3-BASE
- Transformers Pipeline Docs: https://huggingface.co/docs/transformers/main_classes/pipelines
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. 🙏