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

Function rot6d_to_rotmat

detrsmpl/utils/transforms.py:222–241  ·  view source on GitHub ↗

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]
)

Source from the content-addressed store, hash-verified

220
221
222def 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
244def aa_to_ee(axis_angle: Union[torch.Tensor, numpy.ndarray],

Callers 2

__call__Method · 0.90
__call__Method · 0.90

Calls 1

ComposeClass · 0.70

Tested by

no test coverage detected