Convert rotation 6d representations to rotation matrixs. Args: rotation_6d (Union[torch.Tensor, numpy.ndarray]): input shape should be (..., 6). ndim of input is unlimited. Returns: Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3, 3). [1] Zhou
(
rotation_6d: Union[torch.Tensor, numpy.ndarray]
)
| 220 | |
| 221 | |
| 222 | def rot6d_to_rotmat( |
| 223 | rotation_6d: Union[torch.Tensor, numpy.ndarray] |
| 224 | ) -> Union[torch.Tensor, numpy.ndarray]: |
| 225 | """Convert rotation 6d representations to rotation matrixs. |
| 226 | |
| 227 | Args: |
| 228 | rotation_6d (Union[torch.Tensor, numpy.ndarray]): input shape |
| 229 | should be (..., 6). ndim of input is unlimited. |
| 230 | Returns: |
| 231 | Union[torch.Tensor, numpy.ndarray]: shape would be (..., 3, 3). |
| 232 | |
| 233 | [1] Zhou, Y., Barnes, C., Lu, J., Yang, J., & Li, H. |
| 234 | On the Continuity of Rotation Representations in Neural Networks. |
| 235 | IEEE Conference on Computer Vision and Pattern Recognition, 2019. |
| 236 | Retrieved from http://arxiv.org/abs/1812.07035 |
| 237 | """ |
| 238 | if rotation_6d.shape[-1] != 6: |
| 239 | raise ValueError(f'Invalid input rotation_6d f{rotation_6d.shape}.') |
| 240 | t = Compose([rotation_6d_to_matrix]) |
| 241 | return t(rotation_6d) |
| 242 | |
| 243 | |
| 244 | def aa_to_ee(axis_angle: Union[torch.Tensor, numpy.ndarray], |