Skip to content

Commit af111f8

Browse files
committed
explicit method posed joints
1 parent 642bc95 commit af111f8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

STAR/pytorch/star.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,16 @@ def forward(self, pose, betas , trans):
122122
v.v_posed = v_posed
123123
v.v_shaped = v_shaped
124124
return v
125+
126+
def get_joints(self, vertices):
127+
"""
128+
This method is used to get the joint locations from the SMPL mesh
129+
Input:
130+
vertices: size = (B, 6890, 3)
131+
Output:
132+
3D joints: size = (B, 38, 3)
133+
"""
134+
JOINTS_IDX = [e for e in np.arange(24)]
135+
joints = torch.einsum("bik,ji->bjk", [vertices, self.J_regressor])
136+
joints = joints[:, JOINTS_IDX]
137+
return joints

0 commit comments

Comments
 (0)