MCPcopy Create free account
hub / github.com/MotrixLab/MotionDiffuse / get_offsets_joints_batch

Method get_offsets_joints_batch

text2motion/utils/skeleton.py:33–40  ·  view source on GitHub ↗
(self, joints)

Source from the content-addressed store, hash-verified

31
32 # joints (batch_size, joints_num, 3)
33 def get_offsets_joints_batch(self, joints):
34 assert len(joints.shape) == 3
35 _offsets = self._raw_offset.expand(joints.shape[0], -1, -1).clone()
36 for i in range(1, self._raw_offset.shape[0]):
37 _offsets[:, i] = torch.norm(joints[:, i] - joints[:, self._parents[i]], p=2, dim=1)[:, None] * _offsets[:, i]
38
39 self._offset = _offsets.detach()
40 return _offsets
41
42 # joints (joints_num, 3)
43 def get_offsets_joints(self, joints):

Callers 4

forward_kinematicsMethod · 0.95
forward_kinematics_npMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected