| 166 | return tra_pred |
| 167 | |
| 168 | class 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 | |
| 183 | def transform_mat(R, t): |
| 184 | ''' Creates a batch of transformation matrices |
nothing calls this directly
no outgoing calls
no test coverage detected