Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centering joints #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.cache/
.egg-info
smplpytorch.egg-info/
__pycache__/
build/
dist/
Expand Down
5 changes: 5 additions & 0 deletions smplpytorch/pytorch/smpl_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this if block (and the one above in line 147-150) is independent of the surrounding clauses.

## 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)

Expand Down