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

Function aa_to_rot6d

detrsmpl/utils/transforms.py:264–284  ·  view source on GitHub ↗

Convert axis angles to rotation 6d representations. 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 (..., 6). [1] Zhou, Y., Ba

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

Source from the content-addressed store, hash-verified

262
263
264def aa_to_rot6d(
265 axis_angle: Union[torch.Tensor, numpy.ndarray]
266) -> Union[torch.Tensor, numpy.ndarray]:
267 """Convert axis angles to rotation 6d representations.
268
269 Args:
270 axis_angle (Union[torch.Tensor, numpy.ndarray]): input shape
271 should be (..., 3). ndim of input is unlimited.
272
273 Returns:
274 Union[torch.Tensor, numpy.ndarray]: shape would be (..., 6).
275
276 [1] Zhou, Y., Barnes, C., Lu, J., Yang, J., & Li, H.
277 On the Continuity of Rotation Representations in Neural Networks.
278 IEEE Conference on Computer Vision and Pattern Recognition, 2019.
279 Retrieved from http://arxiv.org/abs/1812.07035
280 """
281 if axis_angle.shape[-1] != 3:
282 raise ValueError(f'Invalid input axis_angle f{axis_angle.shape}.')
283 t = Compose([axis_angle_to_matrix, matrix_to_rotation_6d])
284 return t(axis_angle)
285
286
287def ee_to_aa(euler_angle: Union[torch.Tensor, numpy.ndarray],

Callers 2

forwardMethod · 0.90
forwardMethod · 0.90

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected