mlboydaisuke commited on
Commit
5b2565a
·
verified ·
1 Parent(s): dd23c02

Add model card

Browse files
Files changed (1) hide show
  1. README.md +89 -0
README.md ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ library_name: coreml
4
+ pipeline_tag: depth-estimation
5
+ base_model: Ruicheng/moge-2-vitb-normal
6
+ base_model_relation: quantized
7
+ tags:
8
+ - coreml
9
+ - core-ml
10
+ - ios
11
+ - macos
12
+ - apple
13
+ - on-device
14
+ - monocular-depth
15
+ - metric-depth
16
+ - surface-normals
17
+ - dinov2
18
+ - arxiv:2507.02546
19
+ ---
20
+
21
+ # MoGe-2 ViT-B (504×504) — Core ML
22
+
23
+ *Microsoft, CVPR 2025*
24
+
25
+ Monocular geometry from a single image. Metric depth, surface normals, confidence mask. DINOv2 ViT-B/14 backbone.
26
+
27
+ Core ML conversion of [microsoft/MoGe](https://github.com/microsoft/MoGe) for on-device inference on iPhone, iPad and Mac. Converted with `coremltools`; the packages are stateless, so all sequencing and buffering lives in your Swift code.
28
+
29
+ | | |
30
+ |---|---|
31
+ | Task | depth estimation |
32
+ | Upstream | [microsoft/MoGe](https://github.com/microsoft/MoGe) |
33
+ | Packages | 1 |
34
+ | Download size | 184 MB |
35
+ | Minimum iOS | 17.0 |
36
+ | Peak RAM | ~600 MB |
37
+
38
+ ## Files
39
+
40
+ | File | Size | Compute units | SHA-256 |
41
+ |---|---:|---|---|
42
+ | `MoGe2_ViTB_Normal_504.mlpackage.zip` | 184 MB | `all` | `f60cfb4804707a48…` |
43
+ | **Total** | **184 MB** | | |
44
+
45
+ `compute_units` is not a suggestion -- it is the configuration the conversion was verified against. Moving a package to a different compute unit can silently change the numerics (FP16 attention overflow) or crash on the GPU.
46
+
47
+ ## Download
48
+
49
+ ```bash
50
+ hf download mlboydaisuke/coreml-zoo --include "moge2/*" --local-dir ./moge2_vitb_normal_504
51
+ unzip './moge2_vitb_normal_504/moge2/*.zip' -d ./moge2_vitb_normal_504
52
+ ```
53
+
54
+ ## Use in Swift
55
+
56
+ ```swift
57
+ import CoreML
58
+
59
+ let config = MLModelConfiguration()
60
+ config.computeUnits = .all // as converted — see the table above
61
+
62
+ // Unzip the .mlpackage, drop it into your Xcode target and Xcode compiles it
63
+ // at build time:
64
+ let model = try MoGe2_ViTB_Normal_504(configuration: config)
65
+
66
+ // ...or compile a downloaded .mlpackage at runtime:
67
+ let compiled = try await MLModel.compileModel(at: mlpackageURL)
68
+ let model = try MLModel(contentsOf: compiled, configuration: config)
69
+ ```
70
+
71
+ ## Demo
72
+
73
+ - **Sample app** — [`sample_apps/MoGe2Demo`](https://github.com/john-rocky/CoreML-Models/tree/master/sample_apps/MoGe2Demo), a standalone SwiftUI project.
74
+ - **Models Zoo** — this model is downloadable and runnable inside the [Models Zoo app](https://apps.apple.com/app/id6762083207) on the App Store, no build required.
75
+
76
+ ## Conversion
77
+
78
+ - Script: [`convert_moge2.py`](https://github.com/john-rocky/CoreML-Models/blob/master/conversion_scripts/convert_moge2.py)
79
+ - Pitfalls hit during conversion (FP16 overflow, ANE buffer limits, stride handling): [`docs/coreml_conversion_notes.md`](https://github.com/john-rocky/CoreML-Models/blob/master/docs/coreml_conversion_notes.md)
80
+ - Model index: [CoreML-Models](https://github.com/john-rocky/CoreML-Models)
81
+
82
+ ## License
83
+
84
+ The conversion inherits the upstream license: **MIT**.
85
+
86
+ ## Credits
87
+
88
+ - Upstream authors: [microsoft/MoGe](https://github.com/microsoft/MoGe), 2025
89
+ - Core ML conversion: john-rocky (Daisuke Majima)