Skip to content

Latest commit

 

History

History
23 lines (16 loc) · 889 Bytes

README.md

File metadata and controls

23 lines (16 loc) · 889 Bytes

Mesh Morpher

Use this repository to turn one mesh into another with the power of NVIDIA-Kaolin and Pytorch.

sample car obj

Method

We calculate the chamfer distance between 2 sampled meshes and backpropagate through it to morph a template mesh into the target. Edge length regularization is used to improve smoothness.

optimizer = torch.optim.Adam([m1.vertices],lr=0.01)

for i in range(epochs):

    optimizer.zero_grad()
    loss=chamfer_distance(m1,m2) + edge_length(m1)
    loss.backward()
    optimizer.step()

Usage

  1. Download dependencies: kaolin, pytorch, tqdm, numpy, plotly
  2. Open the jupyter notebook tutorial.ipynb and run all cells. Change path in the get_model function to load your own mesh.