Skip to content

vaibhavnayel/meshmorpher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Using Kaolin to morph meshes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published