Skip to content

Commit 408fca9

Browse files
authored
Merge pull request #72 from jclarkk/main
Perform laplacian smoothing when fitting mesh
2 parents 85f4429 + 2bece9c commit 408fca9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

algorithms/nerf_marching_cubes_converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ def fit_mesh(self, iters=2048, resolution=512, decimate_target=5e4):
288288
image_pred, alpha_pred = self.render_mesh(pose)
289289

290290
loss_mse = F.mse_loss(image_pred, image_gt) + 0.1 * F.mse_loss(alpha_pred, alpha_gt)
291-
# loss_lap = laplacian_smooth_loss(self.v + self.deform, self.f)
291+
loss_lap = laplacian_smooth_loss(self.v + self.deform, self.f)
292292
loss_normal = normal_consistency(self.v + self.deform, self.f)
293293
loss_offsets = (self.deform ** 2).sum(-1).mean()
294-
loss = loss_mse + 0.001 * loss_normal + 0.1 * loss_offsets
294+
loss = loss_mse + 0.001 * loss_normal + 0.1 * loss_offsets * loss_lap * 0.01
295295

296296
loss.backward()
297297

0 commit comments

Comments
 (0)