MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / align_depth_scale

Function align_depth_scale

modeling/pi3/utils/alignment.py:149–160  ·  view source on GitHub ↗

Align `depth_src` to `depth_tgt` with given constant weights. ### Parameters: - `depth_src: torch.Tensor` of shape (..., N) - `depth_tgt: torch.Tensor` of shape (..., N)

(depth_src: torch.Tensor, depth_tgt: torch.Tensor, weight: Optional[torch.Tensor], trunc: Optional[Union[float, torch.Tensor]] = None)

Source from the content-addressed store, hash-verified

147
148
149def align_depth_scale(depth_src: torch.Tensor, depth_tgt: torch.Tensor, weight: Optional[torch.Tensor], trunc: Optional[Union[float, torch.Tensor]] = None):
150 """
151 Align `depth_src` to `depth_tgt` with given constant weights.
152
153 ### Parameters:
154 - `depth_src: torch.Tensor` of shape (..., N)
155 - `depth_tgt: torch.Tensor` of shape (..., N)
156
157 """
158 scale, _, _ = align(depth_src, depth_tgt, weight, trunc)
159
160 return scale
161
162
163def align_depth_affine(depth_src: torch.Tensor, depth_tgt: torch.Tensor, weight: Optional[torch.Tensor], trunc: Optional[Union[float, torch.Tensor]] = None):

Callers

nothing calls this directly

Calls 1

alignFunction · 0.70

Tested by

no test coverage detected