pyramid ready for cape

This commit is contained in:
2023-05-22 12:44:43 +02:00
parent 6b81c0d1a6
commit 60844f8011
5 changed files with 321 additions and 9 deletions
+10 -1
View File
@@ -23,10 +23,19 @@ from losses.losses import _nearest_neighbour
# F = np.load("smpl/smpl_faces.npy")
to_keep = sio.loadmat('smpl/keep_remove.mat')['keep'].reshape(-1)
F_fix_coll = torch.tensor(np.tile(np.load("smpl/smpl_faces.npy")[to_keep,:][None,:,:], [4,1,1]), device='cuda')
smpl_to_keep_orig_post = sio.loadmat('smpl/keep_remove.mat')['keep'].reshape(-1)
smpl_to_keep_orig_post = smpl_to_keep_orig_post[smpl_to_keep_orig_post < 6890]
F_fix_coll_orig = torch.tensor(np.tile(np.load("smpl/smpl_faces_orig.npy")[:6890,:][None,:,:], [4,1,1]), device='cuda')[:,smpl_to_keep_orig_post,:]
def fix_collision(V: torch.Tensor, B: torch.Tensor, mask: torch.Tensor, thr=.004):
mesh = Meshes(B, F_fix_coll)
if V.shape[1] == 14475:
F_fix_coll_local = F_fix_coll
elif V.shape[1] == 3638:
F_fix_coll_local = F_fix_coll_orig
else:
raise ValueError("V must have 14475 or 3638 vertices")
mesh = Meshes(B, F_fix_coll_local)
B_vn = torch.stack(mesh.verts_normals_list())
# compute correspondences