Depth Estimation
Core ML
Depth Pro
visionos
apple-silicon
amlr
computer-vision
512x512
ane-optimized
Instructions to use aarondevstack/DepthPro-512x512-coreml with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Depth Pro
How to use aarondevstack/DepthPro-512x512-coreml with Depth Pro:
# Download checkpoint pip install huggingface-hub huggingface-cli download --local-dir checkpoints aarondevstack/DepthPro-512x512-coreml
import depth_pro # Load model and preprocessing transform model, transform = depth_pro.create_model_and_transforms() model.eval() # Load and preprocess an image. image, _, f_px = depth_pro.load_rgb("example.png") image = transform(image) # Run inference. prediction = model.infer(image, f_px=f_px) # Results: 1. Depth in meters depth = prediction["depth"] # Results: 2. Focal length in pixels focallength_px = prediction["focallength_px"] - Notebooks
- Google Colab
- Kaggle
| license: apple-ascl | |
| library_name: coreml | |
| tags: | |
| - depth-estimation | |
| - visionos | |
| - apple-silicon | |
| - amlr | |
| - computer-vision | |
| - depth-pro | |
| - 512x512 | |
| - ane-optimized | |
| extra_gated_heading: DepthPro CoreML (Fast 512px - ANE Optimized) | |
| extra_gated_button_content: Access Model | |
| # DepthPro CoreML (512x512 Real-Time) | |
| This repository contains the **Fast (512x512)** version of the DepthPro model, specifically optimized for the **Apple Neural Engine (ANE)**. | |
| DepthPro is a state-of-the-art monocular depth estimation model. This 512px version is designed for **Real-Time Previews** and high-speed video conversion on Apple Vision Pro and Apple Silicon Macs. | |
| ## π Key Features | |
| - **ANE Accelerated**: Leveraging the Apple Neural Engine for ultra-low power and high-speed inference. | |
| - **Real-Time Performance**: Ideal for interactive parameter tuning (Max Disparity, Convergence Plane). | |
| - **VisionOS Ready**: Fully compatible with Apple Vision Pro via the `DepthProPipeline`. | |
| ## π Performance & Requirements | |
| | Metric | Specification | | |
| | :--- | :--- | | |
| | **Input Resolution** | 512 x 512 pixels | | |
| | **Compute Units** | All (Optimized for ANE) | | |
| | **Average Latency** | < 1.0s per frame (on M2/M3 chips) | | |
| | **Target Use Case** | Real-time 3D Preview / Quick Video Conversion | | |
| > [!TIP] | |
| > This model is the best choice for the initial phase of your 3D conversion workflow, allowing for near-instant feedback while adjusting 3D rendering parameters. | |
| ## π¦ Repository Contents | |
| The repository contains the following core components: | |
| 1. `DepthPro_transform.mlpackage`: Image preprocessing. | |
| 2. `DepthPro_encoder.mlpackage`: Feature extraction (ANE Optimized). | |
| 3. `DepthPro_decoder.mlpackage`: Multiresolution fusion. | |
| 4. `DepthPro_depth.mlpackage`: Final depth output. | |
| ## π Usage with Swift Transformers | |
| You can download and cache this model dynamically using `swift-transformers`: | |
| ```swift | |
| let hub = Hub() | |
| let modelDir = try await hub.snapshot(repoId: "aarondevstack/DepthPro-512x512-coreml") | |
| // Load models from the downloaded directory | |