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]
)
| 71 | |
| 72 | |
| 73 | def 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 | |
| 92 | def aa_to_quat( |
no test coverage detected