Kyle Pearson commited on
Commit ·
02dc205
1
Parent(s): 2dd97e7
docs
Browse files
README.md
CHANGED
|
@@ -99,33 +99,6 @@ Options:
|
|
| 99 |
|
| 100 |
The PLY uses the same binary format as [SHARP](https://github.com/apple/ml-sharp), with per-pixel positions projected onto a sphere using estimated depth, image-derived colors (SH0), uniform scale/opacity, and identity quaternions.
|
| 101 |
|
| 102 |
-
## Quick Start — Xcode (iOS / macOS)
|
| 103 |
-
|
| 104 |
-
Add `DAPModel.mlpackage` to your Xcode project (Xcode auto-generates the `DAPModel` Swift class), then use the included `DepthPredictor.swift`:
|
| 105 |
-
|
| 106 |
-
```swift
|
| 107 |
-
import Foundation
|
| 108 |
-
import CoreML
|
| 109 |
-
import Vision
|
| 110 |
-
import CoreImage
|
| 111 |
-
|
| 112 |
-
// Load the model from a .mlpackage URL
|
| 113 |
-
let modelURL = Bundle.main.url(forResource: "DAPModel", withExtension: "mlpackage")!
|
| 114 |
-
let predictor = DepthPredictor(modelURL: modelURL)
|
| 115 |
-
|
| 116 |
-
// Run inference on a CGImage (equirectangular panorama)
|
| 117 |
-
predictor.predictDepth(from: cgImage) { depth in
|
| 118 |
-
guard let depth = depth else { return }
|
| 119 |
-
// `depth` is a DepthResult with raw Float32 values and a CIImage
|
| 120 |
-
|
| 121 |
-
// Colorize with jet colormap
|
| 122 |
-
let colorized = predictor.applyJetColormap(to: depth)
|
| 123 |
-
|
| 124 |
-
// Or access raw depth values directly
|
| 125 |
-
let values = depth.getDepthValues() // [Float32], row-major
|
| 126 |
-
}
|
| 127 |
-
```
|
| 128 |
-
|
| 129 |
## Files
|
| 130 |
|
| 131 |
| File | Description |
|
|
|
|
| 99 |
|
| 100 |
The PLY uses the same binary format as [SHARP](https://github.com/apple/ml-sharp), with per-pixel positions projected onto a sphere using estimated depth, image-derived colors (SH0), uniform scale/opacity, and identity quaternions.
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
## Files
|
| 103 |
|
| 104 |
| File | Description |
|