Skip to content

Commit

Permalink
remove progress output for marching cubes
Browse files Browse the repository at this point in the history
  • Loading branch information
niujinshuchong committed Dec 15, 2022
1 parent 43d5d19 commit 8c0ef3b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions nerfstudio/utils/marching_cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ def get_surface_sliding(
ys = np.linspace(grid_min[1], grid_max[1], N + 1)
zs = np.linspace(grid_min[2], grid_max[2], N + 1)

print(xs)
print(ys)
print(zs)
# print(xs)
# print(ys)
# print(zs)
meshes = []
for i in range(N):
for j in range(N):
for k in range(N):
print(i, j, k)
# print(i, j, k)
x_min, x_max = xs[i], xs[i + 1]
y_min, y_max = ys[j], ys[j + 1]
z_min, z_max = zs[k], zs[k + 1]
Expand Down Expand Up @@ -101,11 +101,11 @@ def evaluate(points):
else:
mask = mask.reshape(-1)
pts_to_eval = pts[mask]
# import pdb; pdb.set_trace()

if pts_to_eval.shape[0] > 0:
pts_sdf_eval = evaluate(pts_to_eval.contiguous())
pts_sdf[mask] = pts_sdf_eval
print("ratio", pts_to_eval.shape[0] / pts.shape[0])
# print("ratio", pts_to_eval.shape[0] / pts.shape[0])

if pid < 3:
# update mask
Expand Down Expand Up @@ -139,10 +139,10 @@ def evaluate(points):
),
mask=current_mask,
)
print(np.array([x_min, y_min, z_min]))
print(verts.min(), verts.max())
# print(np.array([x_min, y_min, z_min]))
# print(verts.min(), verts.max())
verts = verts + np.array([x_min, y_min, z_min])
print(verts.min(), verts.max())
# print(verts.min(), verts.max())

meshcrop = trimesh.Trimesh(verts, faces, normals)
# meshcrop.export(f"{i}_{j}_{k}.ply")
Expand Down
2 changes: 2 additions & 0 deletions scripts/extract_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ def main(self) -> None:

_, pipeline, _ = eval_setup(self.load_config)

CONSOLE.print("Extract mesh with marching cubes and may take a while")

if self.is_occupancy:
# for unisurf
get_surface_occupancy(
Expand Down

0 comments on commit 8c0ef3b

Please sign in to comment.