MCPcopy Create free account
hub / github.com/MotrixLab/insactor / get_rot

Function get_rot

data/humanml3d_converter.py:257–266  ·  view source on GitHub ↗
(rot, dt, target_dt)

Source from the content-addressed store, hash-verified

255
256
257def get_rot(rot, dt, target_dt):
258 rot = rot[..., [1, 2, 3, 0]]
259 nframe = rot.shape[0]
260 x = np.arange(nframe) * dt
261 x_target = np.arange(int(nframe * dt / target_dt)) * target_dt
262
263 rotations = Rotation.from_quat(rot)
264 spline = RotationSpline(x, rotations)
265
266 return spline(x_target, 0).as_quat()[:, [3, 0, 1, 2]]
267
268
269if __name__ == '__main__':

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected