Skip to content

Commit

Permalink
Merge pull request #59 from jiangwei221/main
Browse files Browse the repository at this point in the history
Rename variable
  • Loading branch information
anuragranj authored Dec 12, 2022
2 parents 84d4685 + 5b76b03 commit 0149d25
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions preprocess/optimize_smpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ def silhouette_renderer_from_pinhole_cam(cam, device='cpu'):
def vertext_forward(pose, betas, align, body_model, scale):
device = pose.device

da_smpl = torch.zeros_like(pose)
da_smpl = da_smpl.reshape(-1, 3)
T_pose = torch.zeros_like(pose)
T_pose = T_pose.reshape(-1, 3)

_, mesh_transf = body_model.verts_transformations(
return_tensor=True,
Expand All @@ -119,13 +119,13 @@ def vertext_forward(pose, betas, align, body_model, scale):
s = torch.eye(4).to(mesh_transf.device)
s[:3, :3] *= scale
mesh_transf = s @ mesh_transf
da_pose_verts, da_pose_joints = body_model(return_tensor=True,
T_pose_verts, T_pose_joints = body_model(return_tensor=True,
return_joints=True,
poses=da_smpl[None],
poses=T_pose[None],
betas=betas[None],
transl=torch.zeros([1, 3]).float().to(device),
)
world_verts = torch.einsum('bni, bi->bn', mesh_transf[0], ray_utils.to_homogeneous(torch.cat([da_pose_verts, da_pose_joints], dim=0)))[:, :3]
world_verts = torch.einsum('bni, bi->bn', mesh_transf[0], ray_utils.to_homogeneous(torch.cat([T_pose_verts, T_pose_joints], dim=0)))[:, :3]
world_verts, world_joints = world_verts[:6890, :][None], world_verts[6890:, :][None]
return world_verts, world_joints

Expand Down

0 comments on commit 0149d25

Please sign in to comment.