zju3dv / NeuralRecon

Code for "NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video", CVPR 2021 oral
https://zju3dv.github.io/neuralrecon/
Apache License 2.0
2.03k stars 294 forks source link

skimage marching_cubes_lewiner error #134

Closed bloodhunt3r closed 1 year ago

bloodhunt3r commented 1 year ago

when I turn on the save_mesh flag in generate_gt.py, it prompt the following error while saving the tsdf_fusion mesh file:

Traceback (most recent call last):
  File "/home/ran/miniconda3/envs/neucon/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3553, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-18-f7d245c13cb6>", line 1, in <module>
    ttt = tmp_res.get_mesh()
  File "/home/ran/PycharmProjects/NeuralRecon/tools/tsdf_fusion/fusion.py", line 344, in get_mesh
    verts, faces, norms, vals = measure.marching_cubes_lewiner(tsdf_vol, level=0)
AttributeError: module 'skimage.measure' has no attribute 'marching_cubes_lewiner'
bloodhunt3r commented 1 year ago

while I check the skimage source code repo and found that they have updated the marching_cubes_lewiner function after 0.18.3:

def marching_cubes_lewiner(volume, level=None, spacing=(1., 1., 1.),
                           gradient_direction='descent', step_size=1,
                           allow_degenerate=True, use_classic=False, mask=None):
    """
    Lewiner marching cubes algorithm to find surfaces in 3d volumetric data.

    In contrast to ``marching_cubes_classic()``, this algorithm is faster,
    resolves ambiguities, and guarantees topologically correct results.
    Therefore, this algorithm generally a better choice, unless there
    is a specific need for the classic algorithm.

    Parameters

source

better reinstall scikit-image:

pip install scikit-image==0.18.3

bloodhunt3r commented 1 year ago

problem solved