model card
Browse files
README.md
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- depth-estimation
|
4 |
+
library_name: coreml
|
5 |
+
license: apple-ascl
|
6 |
+
---
|
7 |
+
|
8 |
+
# DepthPro CoreML Models
|
9 |
+
|
10 |
+
[DepthPro paper](https://arxiv.org/pdf/2410.02073)
|
11 |
+
|
12 |
+
[DepthPro original repo](https://huggingface.co/apple/DepthPro)
|
13 |
+
|
14 |
+
## Model Variants
|
15 |
+
|
16 |
+
| Variant | Size (MB) |
|
17 |
+
| ------------------------------------------------------- | ---------: |
|
18 |
+
|[DepthPro](DepthPro.mlpackage)| 1900 |
|
19 |
+
|[DepthPro: Pruned 10% Sparsity, Quantized Linear Symmetric](DepthPro-pruned10-Qlinear.mlpackage)| 1100 |
|
20 |
+
|[DepthPro Normalized Inverse Depth](DepthProNormalizedInverseDepth.mlpackage)| 1290 |
|
21 |
+
|[DepthPro Normalized Inverse Depth: Pruned 10% Sparsity, Quantized Linear Symmetric](DepthPro-pruned10-Qlinear.mlpackage)| 745 |
|
22 |
+
|
23 |
+
## Model Inputs and Outputs
|
24 |
+
|
25 |
+
### DepthPro Normalized Inverse Depth Models
|
26 |
+
|
27 |
+
#### Inputs
|
28 |
+
|
29 |
+
- `pixel_values`: 1536x1536 3 color image.
|
30 |
+
|
31 |
+
#### Outputs
|
32 |
+
|
33 |
+
- `normalized_inverse_depth` 1536x1536 monochrome image.
|
34 |
+
|
35 |
+
### DepthPro Models
|
36 |
+
|
37 |
+
#### Inputs
|
38 |
+
|
39 |
+
- `pixel_values`: 1536x1536 3 color image.
|
40 |
+
- `original_widths`: 1x1x1x1 Tensor containing the original width of the image before resizing.
|
41 |
+
|
42 |
+
#### Outputs
|
43 |
+
|
44 |
+
- `depth_meters`: 1x1x1536x1536 Tensor containing depth in meters.
|
45 |
+
|
46 |
+
## Download
|
47 |
+
|
48 |
+
Install `huggingface-cli`
|
49 |
+
|
50 |
+
```bash
|
51 |
+
brew install huggingface-cli
|
52 |
+
```
|
53 |
+
|
54 |
+
To download one of the `.mlpackage` folders to the `models` directory:
|
55 |
+
|
56 |
+
```bash
|
57 |
+
huggingface-cli download \
|
58 |
+
--local-dir models --local-dir-use-symlinks False \
|
59 |
+
KeighBee/coreml-DepthPro \
|
60 |
+
--include "DepthProNormalizedInverseDepth-pruned10-Qlinear.mlpackage/*" "DepthPro-pruned10-Qlinear.mlpackage/*"
|
61 |
+
```
|
62 |
+
|
63 |
+
To download everything, skip the `--include` argument.
|
64 |
+
|
65 |
+
## Integrate in Swift apps
|
66 |
+
|
67 |
+
The [`huggingface/coreml-examples`](https://github.com/huggingface/coreml-examples/blob/main/DepthProSample/README.md) repository contains sample Swift code for `DepthProNormalizedInverseDepth-pruned10-Qlinear.mlpackage` and other models. See [the instructions there](https://github.com/huggingface/coreml-examples/tree/main/DepthProSample) to build the demo app, which shows how to use the model in your own Swift apps.
|