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

Function align_points_scale

modeling/pi3/utils/alignment.py:233–248  ·  view source on GitHub ↗

### Parameters: - `points_src: torch.Tensor` of shape (..., N, 3) - `points_tgt: torch.Tensor` of shape (..., N, 3) - `weight: torch.Tensor` of shape (..., N) ### Returns: - `a: torch.Tensor` of shape (...). Only positive solutions are garunteed. You should filter out negat

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

Source from the content-addressed store, hash-verified

231
232
233def align_points_scale(points_src: torch.Tensor, points_tgt: torch.Tensor, weight: Optional[torch.Tensor], trunc: Optional[Union[float, torch.Tensor]] = None):
234 """
235 ### Parameters:
236 - `points_src: torch.Tensor` of shape (..., N, 3)
237 - `points_tgt: torch.Tensor` of shape (..., N, 3)
238 - `weight: torch.Tensor` of shape (..., N)
239
240 ### Returns:
241 - `a: torch.Tensor` of shape (...). Only positive solutions are garunteed. You should filter out negative scales before using it.
242 - `b: torch.Tensor` of shape (...)
243 """
244 dtype, device = points_src.dtype, points_src.device
245
246 scale, _, _ = align(points_src.flatten(-2), points_tgt.flatten(-2), weight[..., None].expand_as(points_src).flatten(-2), trunc)
247
248 return scale
249
250
251def align_points_scale_z_shift(points_src: torch.Tensor, points_tgt: torch.Tensor, weight: Optional[torch.Tensor], trunc: Optional[Union[float, torch.Tensor]] = None):

Callers 1

forwardMethod · 0.50

Calls 1

alignFunction · 0.70

Tested by

no test coverage detected