Views
No views yet
-Views N. Pose is only defined within a window; stitch longer sequences with overlapping windows.s = median(d_metric / d_base) over confidence-gated pixels, then scale the translations by s (rotations and K unchanged).depth-anything-3 0.1.1 package, torch 2.4.x, opset 17, fp32 trace, cartesian_prod and scripted-affine_inverse shims. Conversion script: scripts/export-da3metric.ps1 (this export: -Views 4). Validation: fp32 ONNX matches PyTorch to 6.0e-06 max relative error across all four heads at V=4; batch=2 verified item-wise (windows in a batch don't leak into each other's poses); fp16 matches fp32 to ≤1.1e-03.| File | Variant | Size | Use |
|---|---|---|---|
model.onnx | fp32 | ~394 MB | Default — matches the PyTorch upstream to ~1e-5. |
model_fp16.onnx | fp16 | ~198 MB | Half precision, I/O stays fp32 (keep_io_types) — drop-in swap. |
config.json | — | <1 KB | Upstream DA3 model config (provenance / re-instantiation). |
| Spec | |
|---|---|
| Input name | images |
| Input shape | [batch, 4, 3, 504, 504] — exactly 4 views, each preprocessed like a single image |
| Input dtype | float32 (both variants) |
| Preprocessing | per view: RGB, scale to [0,1], ImageNet mean/std |
Output depth | [batch, 4, 504, 504] — up-to-scale depth per view, bigger = farther |
Output depth_conf | [batch, 4, 504, 504] — per-pixel confidence per view |
Output extrinsics | [batch, 4, 3, 4] — per-view [R | t] world→camera, poses relative within the window (view 0 ≈ reference) |
Output intrinsics | [batch, 4, 3, 3] — per-view K at the 504×504 grid (rescale via diag(W/504, H/504, 1) · K) |
| Dynamic axes | batch only (views and resolution are pinned in the trace) |
1import numpy as np
2import onnxruntime as ort
3from PIL import Image
4
5MEAN, STD = [0.485, 0.456, 0.406], [0.229, 0.224, 0.225]
6
7def prep(path):
8 im = Image.open(path).convert("RGB").resize((504, 504), Image.BILINEAR)
9 x = np.asarray(im, dtype=np.float32) / 255.0
10 return ((x - MEAN) / STD).transpose(2, 0, 1)
11
12frames = np.stack([prep(p) for p in ["f0.jpg", "f1.jpg", "f2.jpg", "f3.jpg"]])[None]
13frames = frames.astype(np.float32) # [1, 4, 3, 504, 504]
14
15sess = ort.InferenceSession("model.onnx")
16depth, conf, ext, K = sess.run(
17 ["depth", "depth_conf", "extrinsics", "intrinsics"], {"images": frames})
18
19# ext[0, v] is the [R|t] of view v relative to the window; unproject each
20# view's depth with K[0, v] and transform by the inverse pose to fuse a
21# single up-to-scale point cloud. Anchor scale with a metric depth model
22# (see the scale note above) to land in meters.