facebookresearch / pifuhd

High-Resolution 3D Human Digitization from A Single Image.
Other
9.5k stars 1.44k forks source link

Simple test doesn't generate .obj fle [error cannot marching cubes] #85

Closed AnMa12 closed 3 years ago

AnMa12 commented 3 years ago

Hello!

I am running the program using: python -m apps.simple_test

It runs and it generates result_test_50.png but the .obj file is not generated

image

shunsukesaito commented 3 years ago

I'm not sure what image you are processing. But seems like surface reconstruction failed on the input image you provided.

archana1998 commented 3 years ago

The reason this happens is because of a different version of PyTorch. Go to lib/geometry.py and remove the align_corners=True argument

remmel commented 2 years ago

Using old version of scikit-image works for me pip install scikit-image==0.18.3 (same version of my Google Colab).

(Note that it works even with that warn: .../pifuhd/lib/mesh_util.py:77: FutureWarning: marching_cubes_lewiner is deprecated in favor of marching_cubes. marching_cubes_lewiner will be removed in version 0.19 verts, faces, normals, values = measure.marching_cubes_lewiner(sdf, thresh)

davidbernat commented 1 year ago

For future users who arrive here, please note that #161, #149, and #85 all resolve to the same issue. The skimage.measure method marching_cubes_lewiner from previous versions of skimage has been deprecated and replaced with marching_cubes.

Line 77 of mesh_util.py can be updated as follows and allows users to use up-to-date versions of skimage as well.

currently in repo: verts, faces, normals, values = measure.marching_cubes_lewiner(sdf, thresh) replace to: verts, faces, normals, values = measure.marching_cubes(sdf, thresh, method="lewiner")

If the authors (@shunsukesaito) would like to authorize a pull request I will make the update.

Galadirith commented 1 year ago

In case anyone in the future is unsure how to modify source files in the Colab environment create a new code cell just before the cell containing !python -m apps.simple_test ... with the following content

%%bash
sed -i 's:marching_cubes_lewiner:marching_cubes:' /content/pifuhd/lib/mesh_util.py
grep 'marching_cubes.' /content/pifuhd/lib/mesh_util.py

image

There are many ways to fix it in the colab environment, this is just one way that works.