NVIDIAGameWorks/kaolin

Question about "dmtet_tutorial.ipynb"

ug-kim opened this issue · 0 comments

Hi, thank you for sharing this awesome work.

I have some questions about dmtet_tutorial.ipynb.

tet_verts = torch.tensor(np.load('../samples/{}_verts.npz'.format(grid_res))['data'], dtype=torch.float, device=device)
tets = torch.tensor(([np.load('../samples/{}_tets_{}.npz'.format(grid_res, i))['data'] for i in range(4)]), dtype=torch.long, device=device).permute(1,0

...

pred = model(tet_verts) # predict SDF and per-vertex deformation
sdf, deform = pred[:,0], pred[:,1:]
verts_deformed = tet_verts + torch.tanh(deform) / grid_res # constraint deformation to avoid flipping tets
mesh_verts, mesh_faces = kaolin.ops.conversions.marching_tetrahedra(verts_deformed.unsqueeze(0), tets, sdf.unsqueeze(0)) # running MT (batched) to extra

In the above code, what is the difference between tets_verts and tets?
I understood about this like that tets_verts is a vertex with deformation and tets is the tetrahedral grid which is not changed because it is the grid basis.

Is is correct or could you give more explanations about these?