(self, features)
| 507 | return nn.Sequential(*layers) |
| 508 | |
| 509 | def forward(self, features): |
| 510 | batch_size = features.shape[0] |
| 511 | |
| 512 | init_pose = self.init_pose.expand(batch_size, -1) # N, Jx6 |
| 513 | init_shape = self.init_shape.expand(batch_size, -1) |
| 514 | init_cam = self.init_cam.expand(batch_size, -1) |
| 515 | |
| 516 | output = {} |
| 517 | |
| 518 | part_feats = self._get_2d_branch_feats(features) |
| 519 | |
| 520 | part_attention = self._get_part_attention_map(part_feats, output) |
| 521 | |
| 522 | smpl_feats = self._get_3d_smpl_feats(features, part_feats) |
| 523 | |
| 524 | point_local_feat, cam_shape_feats = self._get_local_feats( |
| 525 | smpl_feats, part_attention, output) |
| 526 | |
| 527 | pred_pose, pred_shape, pred_cam = self._get_final_preds( |
| 528 | point_local_feat, cam_shape_feats, init_pose, init_shape, init_cam) |
| 529 | |
| 530 | pred_rotmat = rot6d_to_rotmat(pred_pose).reshape(batch_size, 24, 3, 3) |
| 531 | |
| 532 | output.update({ |
| 533 | 'pred_pose': pred_rotmat, |
| 534 | 'pred_cam': pred_cam, |
| 535 | 'pred_shape': pred_shape, |
| 536 | }) |
| 537 | return output |
| 538 | |
| 539 | def _get_local_feats(self, smpl_feats, part_attention, output): |
| 540 | # 1x1 conv |
nothing calls this directly
no test coverage detected