Closed special-yang closed 3 years ago
J = torch.einsum('bik,ji->bjk', [v_shaped, self.J_regressor]) J is the joint coordinates?
We also just ran into this issue. Following the example from human body prior (https://github.com/nghorbani/human_body_prior/blob/1936f38aec4bb959f6a8bf4ed304b6aafb42fa30/human_body_prior/body_model/lbs.py#L104), you can transform the joints using this code:
from human_body_prior.body_model.lbs import batch_rigid_transform
...
J_transformed, A = batch_rigid_transform(R.contiguous(), J.contiguous(), self.kintree_table[0].long())
J_transformed += trans.unsqueeze(dim=1)
Credit to @kaufManu for the solution.
We also just ran into this issue. Following the example from human body prior (https://github.com/nghorbani/human_body_prior/blob/1936f38aec4bb959f6a8bf4ed304b6aafb42fa30/human_body_prior/body_model/lbs.py#L104), you can transform the joints using this code:
from human_body_prior.body_model.lbs import batch_rigid_transform ... J_transformed, A = batch_rigid_transform(R.contiguous(), J.contiguous(), self.kintree_table[0].long()) J_transformed += trans.unsqueeze(dim=1)
Credit to @kaufManu for the solution.
STAR/pytorch/star.py / line 90 J = torch.einsum('bik,ji->bjk', [v_shaped, self.J_regressor]) Is J the coordinate of the joint point in the world coordinate system? and Where is the zero point of the world coordinate system
J is in local coordinates. This is why we apply a rotation then a translation. The center of SMPL/STAR is at (0,0,0) which is in the center of the mesh and near the root node but not quite on top.
That's missing from the torch module of STAR, I'll commit it shortly.
J is in local coordinates. This is why we apply a rotation then a translation. The center of SMPL/STAR is at (0,0,0) which is in the center of the mesh and near the root node but not quite on top.
Thank for your help, from human_body_prior.body_model.lbs import batch_rigid_transform ... J_transformed, A = batch_rigid_transform(R.contiguous(), J.contiguous(), self.kintree_table[0].long()) J_transformed += trans.unsqueeze(dim=1)
(1) Apply a translation "J_transformed += trans.unsqueeze(dim=1)" is to get the location in Camera coordinate system?
Hi @ysp568 , this line is to get the model posed joints in the world coordinate. I added the model posed joints for the torch module line 144-152 https://github.com/ahmedosman/STAR/blob/master/star/pytorch/star.py you can simply get the 24 posed joints by star.J_transformed
I am going to close this issue now.
v = torch.matmul(T, rest_shape_h[:, :, :, None])[:, :, :3, 0] v = v + trans[:,None,:] v.f = self.f v.v_posed = v_posed v.v_shaped = v_shaped
v is a tensor v.f???a