MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / get_depth

Function get_depth

splat_inference.py:42–52  ·  view source on GitHub ↗

Load and resize a depth map.

(path, H, W)

Source from the content-addressed store, hash-verified

40 return img
41
42def get_depth(path, H, W):
43 """Load and resize a depth map."""
44 if path.endswith('.exr'):
45 depth = cv2.imread(path, cv2.IMREAD_ANYDEPTH | cv2.IMREAD_UNCHANGED)
46 else:
47 depth = cv2.imread(path, cv2.IMREAD_ANYDEPTH)
48 if depth is None:
49 depth = np.zeros((H, W), dtype=np.float32)
50 else:
51 depth = cv2.resize(depth.astype(np.float32), (W, H), interpolation=cv2.INTER_LINEAR)
52 return depth
53
54def load_model_weights(model, decoder_path, device, compile=False):
55 """Loads weights from the trained decoder checkpoint."""

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected