jchibane / if-net

Implicit Feature Network (IF-Net) - Codebase
305 stars 59 forks source link

"IndexError: index 0 is out of bounds for axis 0 with size 0" when running voxelized_pointcloud_sampling.py #25

Closed Bingoang closed 3 years ago

Bingoang commented 3 years ago

Hi,Julian

I know you've been really busy in recent days, sorry to bother you! I found something strange when running the 2 commands: (1)python data_processing/convert_to_scaled_off.py (2)python data_processing/voxelized_pointcloud_sampling.py -res 256 -num_points 3000

When I use the ShapeNet models, the above 2 commands go correctly, and do generate the correct files, such as isosurf.off, isosurf_scaled.off, and voxelized_point_cloud_256res_3000points.npz.

BUT, when I use your release test models(e.g. BMan0201-HD2-O04P05-S_3DSV_H250_W250_res256.off) or my own single-view human point cloud models, (I've already change their name to "isosurf.off" to run the commands), the above 2 commands go wrong:

(1)when running: python data_processing/convert_to_scaled_off.py, the errors are:

$ python data_processing/convert_to_scaled_off.py
111
Error with shapenet/data/123/BMan0201-HD2-O04P05-S_3DSV_H250_W250_res256
Finished shapenet/data/123/BMan0201-HD2-O04P05-S_3DSV_H250_W250_res256

PS: I add 2 lines of codes in "convert_to_scaled_off.py" to print sth, the screenshot is as follows. '111' can be printed, so it proves the file "isosurf.off" is already loaded, but mesh.bounds[0] cannot be printed, so I guess sth goes wrong from there. 2020-11-14 19-45-20-codes 2020-11-14 19-53-31-Error

(2)when running: python data_processing/voxelized_pointcloud_sampling.py -res 256 -num_points 3000,the errors are:

$ python data_processing/voxelized_pointcloud_sampling.py -res 256 -num_points 3000
Error with shapenet/data/123/BMan0201-HD2-O04P05-S_3DSV_H250_W250_res256/: Traceback (most recent call last):
  File "data_processing/voxelized_pointcloud_sampling.py", line 29, in voxelized_pointcloud_sampling
    point_cloud = mesh.sample(args.num_points)
  File "/home/ang/anaconda3/envs/if-net/lib/python3.7/site-packages/trimesh/base.py", line 2132, in sample
    samples, index = sample.sample_surface(mesh=self, count=count)
  File "/home/ang/anaconda3/envs/if-net/lib/python3.7/site-packages/trimesh/sample.py", line 52, in sample_surface
    tri_origins = tri_origins[face_index]
IndexError: index 0 is out of bounds for axis 0 with size 0

2020-11-14 19-54-57-IndexError

I've been searching the related information on the google, but still cannot find ways to solve them. So I need your advice. Sorry again to bother you! Thanks a lot!

Best Wishes!

jchibane commented 3 years ago

Hi @Bingoang ,

will look into this after deadline (23.11) ! Thanks and best, Julian

Bingoang commented 3 years ago

Thanks a lot! Wish you all the best!

jchibane commented 3 years ago

Hi @Bingoang ,

the preprocessing you are looking at is designed for meshes with triangles, not for point clouds - this is why you get the error.

Please have a look at my answer to your question in Issue #27 .

Best, Julian