diff --git a/lib/datasets/light_stage/multi_view_mesh_dataset.py b/lib/datasets/light_stage/multi_view_mesh_dataset.py index 3893dba..7407821 100644 --- a/lib/datasets/light_stage/multi_view_mesh_dataset.py +++ b/lib/datasets/light_stage/multi_view_mesh_dataset.py @@ -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, diff --git a/lib/networks/renderer/if_mesh_renderer.py b/lib/networks/renderer/if_mesh_renderer.py index e279577..c62bcdc 100644 --- a/lib/networks/renderer/if_mesh_renderer.py +++ b/lib/networks/renderer/if_mesh_renderer.py @@ -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}