Depth Estimation
Core ML
pcuenq HF staff commited on
Commit
5ed1910
1 Parent(s): 4a62b07

Core ML versions of Depth Anything V2 (small)

Browse files
Files changed (28) hide show
  1. DepthAnythingV2SmallF16INT8.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  2. DepthAnythingV2SmallF16INT8.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  3. DepthAnythingV2SmallF16INT8.mlpackage/Manifest.json +18 -0
  4. DepthAnythingV2SmallF16P4.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  5. DepthAnythingV2SmallF16P4.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  6. DepthAnythingV2SmallF16P4.mlpackage/Manifest.json +18 -0
  7. DepthAnythingV2SmallF16P6.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  8. DepthAnythingV2SmallF16P6.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  9. DepthAnythingV2SmallF16P6.mlpackage/Manifest.json +18 -0
  10. DepthAnythingV2SmallF16P8.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  11. DepthAnythingV2SmallF16P8.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  12. DepthAnythingV2SmallF16P8.mlpackage/Manifest.json +18 -0
  13. DepthAnythingV2SmallF32.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  14. DepthAnythingV2SmallF32.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  15. DepthAnythingV2SmallF32.mlpackage/Manifest.json +18 -0
  16. DepthAnythingV2SmallF32INT8.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  17. DepthAnythingV2SmallF32INT8.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  18. DepthAnythingV2SmallF32INT8.mlpackage/Manifest.json +18 -0
  19. DepthAnythingV2SmallF32P4.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  20. DepthAnythingV2SmallF32P4.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  21. DepthAnythingV2SmallF32P4.mlpackage/Manifest.json +18 -0
  22. DepthAnythingV2SmallF32P6.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  23. DepthAnythingV2SmallF32P6.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  24. DepthAnythingV2SmallF32P6.mlpackage/Manifest.json +18 -0
  25. DepthAnythingV2SmallF32P8.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
  26. DepthAnythingV2SmallF32P8.mlpackage/Data/com.apple.CoreML/weights/weight.bin +3 -0
  27. DepthAnythingV2SmallF32P8.mlpackage/Manifest.json +18 -0
  28. README.md +66 -0
DepthAnythingV2SmallF16INT8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4be16401d5bf1711773dd0045c25ab9d6c6060c31431a551c673d48d8437cd77
3
+ size 427587
DepthAnythingV2SmallF16INT8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:634f38a9788947f29abe4bf0c2459eb11844910f590ca1839624706e4f46c897
3
+ size 24967424
DepthAnythingV2SmallF16INT8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "9322E654-D0EA-4B0D-809E-1123512E7CA8": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "9518B9F0-0BD9-4ACD-AA23-AE6B13E9989C": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "9322E654-D0EA-4B0D-809E-1123512E7CA8"
18
+ }
DepthAnythingV2SmallF16P4.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ff99128c88aa39ea359f153c3c99af00846f5d71ba49dfaf06ccbfd0917e92a4
3
+ size 416472
DepthAnythingV2SmallF16P4.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e8968556dfa6717c8bf6a546d4dca2d5fc6db0630c6678cb75f02ce36f8ac98
3
+ size 12450432
DepthAnythingV2SmallF16P4.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "4D9D69B5-6F11-4BC6-996E-8EA26C46622E": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "7313423C-E748-4AEC-AB0A-511F96C177A1": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "4D9D69B5-6F11-4BC6-996E-8EA26C46622E"
18
+ }
DepthAnythingV2SmallF16P6.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e8e644d1c634417f4e3e0238ef91f87caf3c9d3a3e10f5f751a31a0f39982cfe
3
+ size 416488
DepthAnythingV2SmallF16P6.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3e03128e617d3ed1b0a432d40299523d0e26b31eced30c381540d71f500f5fec
3
+ size 18621888
DepthAnythingV2SmallF16P6.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "73E5441D-BC90-47DB-B11E-86EDDF361455": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "C363FFC2-2D57-4720-AF58-D18BD5C6C228": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "73E5441D-BC90-47DB-B11E-86EDDF361455"
18
+ }
DepthAnythingV2SmallF16P8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d7661be2f565db223aec073abe34c87a49e840e84826ceb6c4986d391c30154c
3
+ size 416615
DepthAnythingV2SmallF16P8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2376be57af5a77d993a5607677fc1b6095f087c2b828bdc29588af3cc14075de
3
+ size 24830720
DepthAnythingV2SmallF16P8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "41F95E8D-5201-4456-BAEA-7E50A468E877": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "E9B7A553-3950-4D3D-A044-06CF27134C65": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "41F95E8D-5201-4456-BAEA-7E50A468E877"
18
+ }
DepthAnythingV2SmallF32.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96485f41d5ea89041cf44e3ff3bc24abd0c6c9a1e46626ae161380a7ee82742f
3
+ size 366829
DepthAnythingV2SmallF32.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:29b97557977ab3f92d4612cdfd60b4c6ec173ea90bd3be8a5820820f037c7e10
3
+ size 98821504
DepthAnythingV2SmallF32.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "0CBDA2BC-C7FA-463F-A588-D74A3F89A68E": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "33A63753-4958-45C5-821D-3470F2773D6B": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "0CBDA2BC-C7FA-463F-A588-D74A3F89A68E"
18
+ }
DepthAnythingV2SmallF32INT8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c6fcd74180fd8fff0c3cf12eac10fd6771c347c3ed1ca3752aba8103fa987c5
3
+ size 394981
DepthAnythingV2SmallF32INT8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8a654997c128da2e9837ec23b3be1b8bc6b9c7169c366a2954bb440ec2c026ff
3
+ size 25184320
DepthAnythingV2SmallF32INT8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "1894CF5B-F3B1-448C-8786-CA224E68C529": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "F6A80ADC-B6D8-4409-AEE0-088308E36465": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "F6A80ADC-B6D8-4409-AEE0-088308E36465"
18
+ }
DepthAnythingV2SmallF32P4.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5607c6652f97babee661561c8d0dc09f705e8499f14b8b24c6e96b543f39b838
3
+ size 383865
DepthAnythingV2SmallF32P4.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa310b0a3c66b5c4b3a65529b2f234b721f283784b2335b5f1c9f63962591552
3
+ size 12541376
DepthAnythingV2SmallF32P4.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "C4FDFD8A-154D-405E-A61B-FBC50C4321E9": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "DB1A3A08-6EE1-480E-B476-11E045DFB54B": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "DB1A3A08-6EE1-480E-B476-11E045DFB54B"
18
+ }
DepthAnythingV2SmallF32P6.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7eeda31ce89c73204c095e27f45f4d2b2b60aea88b68301de6f9deda413a4e76
3
+ size 383879
DepthAnythingV2SmallF32P6.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97bbe2339fb2021c80b99563bf8533d395c61dc4ffc4bc4c1a4067269e988be8
3
+ size 18727808
DepthAnythingV2SmallF32P6.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "41DB15D2-68BD-4B10-A6EB-A6D639567CC0": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Weights",
7
+ "name": "weights",
8
+ "path": "com.apple.CoreML/weights"
9
+ },
10
+ "499D5EB4-43B9-4F3A-BBB5-7C4DC15208C9": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Specification",
13
+ "name": "model.mlmodel",
14
+ "path": "com.apple.CoreML/model.mlmodel"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "499D5EB4-43B9-4F3A-BBB5-7C4DC15208C9"
18
+ }
DepthAnythingV2SmallF32P8.mlpackage/Data/com.apple.CoreML/model.mlmodel ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54d1841ec40e85c6c9a666777570b5f49bcbcf4d5f949815cdb8217b4c017b91
3
+ size 384011
DepthAnythingV2SmallF32P8.mlpackage/Data/com.apple.CoreML/weights/weight.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cefe343258746cfad9086007e8b7d277e0e7ebe902f6b7dbe38fabc6713766f1
3
+ size 24981568
DepthAnythingV2SmallF32P8.mlpackage/Manifest.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "fileFormatVersion": "1.0.0",
3
+ "itemInfoEntries": {
4
+ "220EC391-F1C1-41A8-A4EA-6AAA0914F839": {
5
+ "author": "com.apple.CoreML",
6
+ "description": "CoreML Model Specification",
7
+ "name": "model.mlmodel",
8
+ "path": "com.apple.CoreML/model.mlmodel"
9
+ },
10
+ "B0D72298-E05D-4FE7-ACD4-26F2DAC1A89D": {
11
+ "author": "com.apple.CoreML",
12
+ "description": "CoreML Model Weights",
13
+ "name": "weights",
14
+ "path": "com.apple.CoreML/weights"
15
+ }
16
+ },
17
+ "rootModelIdentifier": "220EC391-F1C1-41A8-A4EA-6AAA0914F839"
18
+ }
README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - depth-estimation
4
+ library_name: coreml
5
+ license: apache-2.0
6
+ ---
7
+
8
+ # Depth Anything V2 Core ML Models
9
+
10
+ Depth Anything V2 was introduced in [the paper of the same name](https://arxiv.org/abs/2406.09414) by Lihe Yang et al. It uses the same architecture as the original Depth Anything release, but uses synthetic data and a larger capacity teacher model to achieve much finer and robust depth predictions. The original Depth Anything model was introduced in the paper [Depth Anything: Unleashing the Power of Large-Scale Unlabeled Data](https://arxiv.org/abs/2401.10891) by Lihe Yang et al., and was first released in [this repository](https://github.com/LiheYoung/Depth-Anything).
11
+
12
+ ## Model description
13
+
14
+ Depth Anything V2 leverages the [DPT](https://huggingface.co/docs/transformers/model_doc/dpt) architecture with a [DINOv2](https://huggingface.co/docs/transformers/model_doc/dinov2) backbone.
15
+
16
+ The model is trained on ~600K synthetic labeled images and ~62 million real unlabeled images, obtaining state-of-the-art results for both relative and absolute depth estimation.
17
+
18
+ <img src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/model_doc/depth_anything_overview.jpg"
19
+ alt="drawing" width="600"/>
20
+
21
+ <small> Depth Anything overview. Taken from the <a href="https://arxiv.org/abs/2401.10891">original paper</a>.</small>
22
+
23
+ ## Evaluation - Variants
24
+
25
+ | Variant | Parameters | Size (MB) | Weight precision | Act. precision | abs-rel error | abs-rel reference |
26
+ | ------------------------------------------------------- | ---------: | --------: | ---------------- | -------------- | ------------: | ----------------: |
27
+ | [small-original](https://huggingface.co/pcuenq/Depth-Anything-V2-Small-hf) (PyTorch) | 24.8M | 99.2 | Float32 | Float32 | | |
28
+ | [DepthAnythingV2SmallF32](DepthAnythingV2SmallF32.mlpackage) | 24.8M | 99.2 | Float32 | Float32 | 0.0072 | small-original |
29
+ | [DepthAnythingV2SmallF16](DepthAnythingV2SmallF16.mlpackage) | 24.8M | 49.8 | Float16 | Float16 | 0.0089 | small-original |
30
+
31
+ Evaluated on 512 landscape images from the COCO dataset with aspect ratio similar to 4:3. Images were streched to a fixed size of 518x396, and the groundtruth corresponds to the results from the PyTorch model running on CUDA with `float32` precision.
32
+
33
+ ## Evaluation - Inference time
34
+
35
+ The following results use the small-float16 variant.
36
+
37
+ | Device | OS | Inference time (ms) | Dominant compute unit |
38
+ | -------------------- | ---- | ------------------: | --------------------- |
39
+ | iPhone 12 Pro Max | 18.0 | 31.10 | Neural Engine |
40
+ | iPhone 15 Pro Max | 17.4 | 33.90 | Neural Engine |
41
+ | MacBook Pro (M1 Max) | 15.0 | 32.80 | Neural Engine |
42
+ | MacBook Pro (M3 Max) | 15.0 | 24.58 | Neural Engine |
43
+
44
+
45
+ ## Download
46
+
47
+ Install `huggingface-cli`
48
+
49
+ ```bash
50
+ brew install huggingface-cli
51
+ ```
52
+
53
+ To download one of the `.mlpackage` folders to the `models` directory:
54
+
55
+ ```bash
56
+ huggingface-cli download \
57
+ --local-dir models --local-dir-use-symlinks False \
58
+ apple/coreml-depth-anything-small \
59
+ --include "DepthAnythingV2SmallF16.mlpackage/*"
60
+ ```
61
+
62
+ To download everything, skip the `--include` argument.
63
+
64
+ ## Integrate in Swift apps
65
+
66
+ The [`huggingface/coreml-examples`](https://github.com/huggingface/coreml-examples/blob/main/depth-anything-example/README.md) repository contains sample Swift code for `coreml-depth-anything-small-v2` and other models. See [the instructions there](https://github.com/huggingface/coreml-examples/tree/main/depth-anything-example) to build the demo app, which shows how to use the model in your own Swift apps.