コード例 #1
0
ファイル: smpl.py プロジェクト: wine3603/TexturePose
 def forward(self, *args, **kwargs):
     kwargs['get_skin'] = True
     smpl_output = super(SMPL, self).forward(*args, **kwargs)
     joints = vertices2joints(self.J_regressor_cocoplus,
                              smpl_output.vertices)[:, :14]
     output = ModelOutput(vertices=smpl_output.vertices,
                          global_orient=smpl_output.global_orient,
                          body_pose=smpl_output.body_pose,
                          joints=joints,
                          betas=smpl_output.betas,
                          full_pose=smpl_output.full_pose)
     return output
コード例 #2
0
 def forward(self, *args, **kwargs):
     kwargs['get_skin'] = True
     smpl_output = super(SMPL, self).forward(*args, **kwargs)
     extra_joints = vertices2joints(self.J_regressor_extra, smpl_output.vertices)
     joints = torch.cat([smpl_output.joints, extra_joints], dim=1)
     joints = joints[:, self.joint_map, :]
     output = ModelOutput(vertices=smpl_output.vertices,
                          global_orient=smpl_output.global_orient,
                          body_pose=smpl_output.body_pose,
                          joints=joints,
                          betas=smpl_output.betas,
                          full_pose=smpl_output.full_pose)
     return output
コード例 #3
0
ファイル: smpl.py プロジェクト: zhly0/eft
    def forward(self, *args, **kwargs):
        kwargs['get_skin'] = True
        smpl_output = super(SMPL, self).forward(*args, **kwargs)
        reordered_joints = smpl_output.joints[:, self.
                                              joint_map_smpl45_to_openpose19, :]  #Reordering

        new_output = ModelOutput(vertices=smpl_output.vertices,
                                 global_orient=smpl_output.global_orient,
                                 body_pose=smpl_output.body_pose,
                                 joints=reordered_joints,
                                 betas=smpl_output.betas,
                                 full_pose=smpl_output.full_pose)

        return new_output