MCPcopy Create free account
hub / github.com/MoyGcc/vid2avatar / JointMapper

Class JointMapper

preprocessing/preprocessing_utils.py:168–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166 return tra_pred
167
168class JointMapper(nn.Module):
169 def __init__(self, joint_maps=None):
170 super(JointMapper, self).__init__()
171 if joint_maps is None:
172 self.joint_maps = joint_maps
173 else:
174 self.register_buffer('joint_maps',
175 torch.tensor(joint_maps, dtype=torch.long))
176
177 def forward(self, joints, **kwargs):
178 if self.joint_maps is None:
179 return joints
180 else:
181 return torch.index_select(joints, 1, self.joint_maps)
182
183def transform_mat(R, t):
184 ''' Creates a batch of transformation matrices

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected