diff --git a/kiui/gridencoder/src/gridencoder.cu b/kiui/gridencoder/src/gridencoder.cu index b4ac779..cf28c34 100644 --- a/kiui/gridencoder/src/gridencoder.cu +++ b/kiui/gridencoder/src/gridencoder.cu @@ -394,7 +394,7 @@ void grid_encode_forward_cuda(const float *inputs, const scalar_t *embeddings, c case 3: kernel_grid_wrapper(inputs, embeddings, offsets, outputs, B, C, L, max_level, S, H, dy_dx, gridtype, align_corners, interp); break; case 4: kernel_grid_wrapper(inputs, embeddings, offsets, outputs, B, C, L, max_level, S, H, dy_dx, gridtype, align_corners, interp); break; case 5: kernel_grid_wrapper(inputs, embeddings, offsets, outputs, B, C, L, max_level, S, H, dy_dx, gridtype, align_corners, interp); break; - default: throw std::runtime_error{"GridEncoding: C must be 1, 2, 4, or 8."}; + default: throw std::runtime_error{"GridEncoding: D must be 2, 3, 4, or 5."}; } } @@ -630,7 +630,7 @@ void grad_total_variation_cuda(const scalar_t *inputs, const scalar_t *embedding case 3: kernel_grad_tv_wrapper(inputs, embeddings, grad, offsets, weight, B, C, L, S, H, gridtype, align_corners); break; case 4: kernel_grad_tv_wrapper(inputs, embeddings, grad, offsets, weight, B, C, L, S, H, gridtype, align_corners); break; case 5: kernel_grad_tv_wrapper(inputs, embeddings, grad, offsets, weight, B, C, L, S, H, gridtype, align_corners); break; - default: throw std::runtime_error{"GridEncoding: C must be 1, 2, 4, or 8."}; + default: throw std::runtime_error{"GridEncoding: D must be 2, 3, 4, or 5."}; } } diff --git a/kiui/mesh_utils.py b/kiui/mesh_utils.py index b2657e7..56608a5 100644 --- a/kiui/mesh_utils.py +++ b/kiui/mesh_utils.py @@ -30,7 +30,7 @@ def decimate_mesh( - verts, faces, target=5e4, backend="pymeshlab", remesh=False, optimalplacement=True + verts, faces, target=5e4, backend="pymeshlab", remesh=False, optimalplacement=True, verbose=True ): """ perform mesh decimation. @@ -41,6 +41,7 @@ def decimate_mesh( backend (str, optional): algorithm backend, can be "pymeshlab" or "pyfqmr". Defaults to "pymeshlab". remesh (bool, optional): whether to remesh after decimation. Defaults to False. optimalplacement (bool, optional): For flat mesh, use False to prevent spikes. Defaults to True. + verbose (bool, optional): whether to print the decimation process. Defaults to True. Returns: Tuple[np.ndarray]: vertices and faces after decimation. @@ -79,7 +80,8 @@ def decimate_mesh( verts = m.vertex_matrix() faces = m.face_matrix() - print(f"[INFO] mesh decimation: {_ori_vert_shape} --> {verts.shape}, {_ori_face_shape} --> {faces.shape}") + if verbose: + print(f"[INFO] mesh decimation: {_ori_vert_shape} --> {verts.shape}, {_ori_face_shape} --> {faces.shape}") return verts, faces @@ -94,6 +96,7 @@ def clean_mesh( remesh=True, remesh_size=0.01, remesh_iters=3, + verbose=True, ): """ perform mesh cleaning, including floater removal, non manifold repair, and remeshing. @@ -107,6 +110,7 @@ def clean_mesh( remesh (bool, optional): whether to perform a remeshing after all cleaning. Defaults to True. remesh_size (float, optional): the targeted edge length for remeshing. Defaults to 0.01. remesh_iters (int, optional): the iterations of remeshing. Defaults to 3. + verbose (bool, optional): whether to print the cleaning process. Defaults to True. Returns: Tuple[np.ndarray]: vertices and faces after decimation. @@ -157,7 +161,8 @@ def clean_mesh( verts = m.vertex_matrix() faces = m.face_matrix() - print(f"[INFO] mesh cleaning: {_ori_vert_shape} --> {verts.shape}, {_ori_face_shape} --> {faces.shape}") + if verbose: + print(f"[INFO] mesh cleaning: {_ori_vert_shape} --> {verts.shape}, {_ori_face_shape} --> {faces.shape}") return verts, faces