plot cape

This commit is contained in:
2023-07-13 17:11:57 +02:00
parent 2f77e2af18
commit 955e87a0c6
4 changed files with 199 additions and 1 deletions
Binary file not shown.
Binary file not shown.
+3 -1
View File
@@ -174,7 +174,7 @@ class SMPL(Module):
# J = torch.matmul(self.J_regressor, v_shaped)
if verts is None:
J = torch.stack([torch.matmul(self.J_regressor[g.to(torch.long)], v_shaped[i, :, :, g.to(torch.long)]) for i, g in enumerate(betas[:,-1])])
J = torch.stack([torch.matmul(self.J_regressor[torch.greater(g, 0.5).to(torch.long)], v_shaped[i, :, :, torch.greater(g, 0.5).to(torch.long)]) for i, g in enumerate(betas[:,-1])])
else:
J = torch.stack([torch.matmul(self.J_regressor[torch.greater(g, 0.5).to(torch.long)], v_shaped[i, :, :, torch.greater(g, 0.5).to(torch.long)]) for i, g in enumerate(betas[:,-1])])
J0 = J[:,0,:].view((-1, 1, 3))
@@ -222,6 +222,8 @@ class SMPL(Module):
weights = self.weights if verts is not None else self.weights_all
rest_shape_h_ones_local = self.rest_shape_h_ones if verts is not None else self.rest_shape_h_ones_full
if weights.shape[1] == 6890:
rest_shape_h_ones_local = torch.ones((batch_num, 6890, 1), dtype=torch.float32).to(self.device)
T = torch.stack([torch.tensordot(results[i], weights[torch.greater(g, 0.5).to(torch.long)], dims=([0], [1])).permute(2, 0, 1) for i, g in enumerate(betas[:,-1])])
rest_shape_h = torch.cat(
(v_posed, rest_shape_h_ones_local), dim=2