MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / forward

Method forward

detrsmpl/models/heads/pare_head.py:509–537  ·  view source on GitHub ↗
(self, features)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

_get_2d_branch_featsMethod · 0.95
_get_3d_smpl_featsMethod · 0.95
_get_local_featsMethod · 0.95
_get_final_predsMethod · 0.95
rot6d_to_rotmatFunction · 0.90
updateMethod · 0.45

Tested by

no test coverage detected