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

Function aa_to_rotmat

detrsmpl/utils/transforms.py:73–89  ·  view source on GitHub ↗

Convert axis_angle to rotation matrixs. Args: axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape should be (..., 3). ndim of input is unlimited. Returns: Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3, 3).

(
    axis_angle: Union[torch.Tensor, numpy.ndarray]
)

Source from the content-addressed store, hash-verified

71
72
73def aa_to_rotmat(
74 axis_angle: Union[torch.Tensor, numpy.ndarray]
75) -> Union[torch.Tensor, numpy.ndarray]:
76 """
77 Convert axis_angle to rotation matrixs.
78 Args:
79 axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape
80 should be (..., 3). ndim of input is unlimited.
81
82 Returns:
83 Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3, 3).
84 """
85 if axis_angle.shape[-1] != 3:
86 raise ValueError(
87 f'Invalid input axis angles shape f{axis_angle.shape}.')
88 t = Compose([axis_angle_to_matrix])
89 return t(axis_angle)
90
91
92def aa_to_quat(

Callers 10

__call__Method · 0.90
__call__Method · 0.90
_parse_resultMethod · 0.90
_rotate_smpl_poseFunction · 0.90
batch_get_pelvis_orientFunction · 0.90
rotate_poseMethod · 0.90
forwardMethod · 0.90

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected