MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / transform_mat

Function transform_mat

util/smplx/smplx/lbs.py:322–333  ·  view source on GitHub ↗

Creates a batch of transformation matrices Args: - R: Bx3x3 array of a batch of rotation matrices - t: Bx3x1 array of a batch of translation vectors Returns: - T: Bx4x4 Transformation matrix

(R: Tensor, t: Tensor)

Source from the content-addressed store, hash-verified

320
321
322def transform_mat(R: Tensor, t: Tensor) -> Tensor:
323 ''' Creates a batch of transformation matrices
324 Args:
325 - R: Bx3x3 array of a batch of rotation matrices
326 - t: Bx3x1 array of a batch of translation vectors
327 Returns:
328 - T: Bx4x4 Transformation matrix
329 '''
330 # No padding left or right, only add an extra row
331 return torch.cat([F.pad(R, [0, 0, 0, 1]),
332 F.pad(t, [0, 0, 0, 1], value=1)],
333 dim=2)
334
335
336def batch_rigid_transform(rot_mats: Tensor,

Callers 1

batch_rigid_transformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected