diff --git a/.gitignore b/.gitignore index 372a5d8..7e53455 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .cache/ .egg-info +smplpytorch.egg-info/ __pycache__/ build/ dist/ diff --git a/smplpytorch/pytorch/smpl_layer.py b/smplpytorch/pytorch/smpl_layer.py index 5e74741..0b17e54 100644 --- a/smplpytorch/pytorch/smpl_layer.py +++ b/smplpytorch/pytorch/smpl_layer.py @@ -149,6 +149,11 @@ def forward(self, th_jtr = th_jtr - center_joint th_verts = th_verts - center_joint else: + if self.center_idx is not None: + ## Zero out root first + center_joint = th_jtr[:, self.center_idx].unsqueeze(1) + th_jtr = th_jtr - center_joint + th_verts = th_verts - center_joint th_jtr = th_jtr + th_trans.unsqueeze(1) th_verts = th_verts + th_trans.unsqueeze(1)