Skip to content

Commit

Permalink
add transforming reconstructed meshes to the world space
Browse files Browse the repository at this point in the history
  • Loading branch information
pengsida committed Jul 26, 2021
1 parent d31cb30 commit ca1af9a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/datasets/light_stage/multi_view_mesh_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def __getitem__(self, index):
R = cv2.Rodrigues(Rh)[0].astype(np.float32)
latent_index = min(latent_index, cfg.num_train_frame - 1)
meta = {
'wbounds': can_bounds,
'bounds': bounds,
'R': R,
'Th': Th,
Expand Down
4 changes: 4 additions & 0 deletions lib/networks/renderer/if_mesh_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def render(self, batch):

cube = np.pad(cube, 10, mode='constant')
vertices, triangles = mcubes.marching_cubes(cube, cfg.mesh_th)

# vertices = (vertices - 10) * 0.005
# vertices = vertices + batch['wbounds'][0, 0].detach().cpu().numpy()

mesh = trimesh.Trimesh(vertices, triangles)

ret = {'cube': cube, 'mesh': mesh}
Expand Down

0 comments on commit ca1af9a

Please sign in to comment.