Convert smpl pose dict to full pose tensor. Args: smpl_dict (dict): smpl pose dict. Returns: torch: full pose tensor.
(cls, smpl_dict: dict)
| 182 | |
| 183 | @classmethod |
| 184 | def dict2tensor(cls, smpl_dict: dict) -> torch.Tensor: |
| 185 | """Convert smpl pose dict to full pose tensor. |
| 186 | |
| 187 | Args: |
| 188 | smpl_dict (dict): smpl pose dict. |
| 189 | |
| 190 | Returns: |
| 191 | torch: full pose tensor. |
| 192 | """ |
| 193 | assert cls.body_pose_keys.issubset(smpl_dict) |
| 194 | for k in smpl_dict: |
| 195 | if isinstance(smpl_dict[k], np.ndarray): |
| 196 | smpl_dict[k] = torch.Tensor(smpl_dict[k]) |
| 197 | global_orient = smpl_dict['global_orient'].view(-1, 3) |
| 198 | body_pose = smpl_dict['body_pose'].view(-1, 3 * cls.NUM_BODY_JOINTS) |
| 199 | full_pose = torch.cat([global_orient, body_pose], dim=1) |
| 200 | return full_pose |
| 201 | |
| 202 | |
| 203 | class GenderedSMPL(torch.nn.Module): |
no outgoing calls
no test coverage detected