rasmushaugaard / surfemb

SurfEmb (CVPR 2022)
https://surfemb.github.io/
MIT License
77 stars 17 forks source link

Then remove invisible parts of the objects #11

Closed cats0212 closed 2 years ago

cats0212 commented 2 years ago

I run python -m surfemb.scripts.misc.surface_samples_remesh_visible AttributeError: 'pymeshlab.pmeshlab.MeshSet' object has no attribute 'repair_non_manifold_edges_by_removing_faces'

I install pymeshlab==0.2.1 to fix it. But it cause another problem:

0%| | 0/21 [00:00<?, ?it/s] /home/c/surfemb/data/bop/ycbv/models/obj_000013.ply

----------AngleRad 0.523599 Angledeg 30.000000 ratio 0.066987 vn 256 vn2 3821 asked 3821 got 3821 (expecting 255 instead of 256) 0%| | 0/21 [00:02<?, ?it/s] Traceback (most recent call last): File "/home/c/surfemb/surfemb/scripts/misc/surface_samples_remesh_visible.py", line 42, in area_reduction = trimesh.load_mesh(remesh_fp).area / trimesh.load_mesh(mesh_fp).area File "/home/c/anaconda3/envs/surfemb/lib/python3.8/site-packages/trimesh/constants.py", line 153, in timed result = method(*args, **kwargs) File "/home/c/anaconda3/envs/surfemb/lib/python3.8/site-packages/trimesh/exchange/load.py", line 209, in load_mesh results = mesh_loaders[file_type](file_obj, File "/home/c/anaconda3/envs/surfemb/lib/python3.8/site-packages/trimesh/exchange/ply.py", line 106, in load_ply ply_binary(elements, file_obj) File "/home/c/anaconda3/envs/surfemb/lib/python3.8/site-packages/trimesh/exchange/ply.py", line 881, in ply_binary raise ValueError('File is unexpected length!') ValueError: File is unexpected length!

cats0212 commented 2 years ago

Annotated code line 41 and 44 of surface_samples_remesh_visible.py. line 41 #area_reduction = trimesh.load_mesh(remesh_fp).area / trimesh.load_mesh(mesh_fp).area

But I run python -m surfemb.scripts.misc.surface_samples_sample_even another problem: Traceback (most recent call last): File "/home/c/surfemb/surfemb/scripts/misc/surface_samples_sample_even.py", line 28, in ms.load_new_mesh(str(mesh_fp.absolute())) pymeshlab.pmeshlab.PyMeshLabException: Unable to open file: /home/c/surfemb/data/remesh_visible/ycbv/obj_000013.ply Error encountered while loading file: "/home/c/surfemb/data/remesh_visible/ycbv/obj_000013.ply"

Error details: Bad vertex index in face

packages in environment

trimesh 3.10.8 pymeshlab 0.2.1

hengseuer commented 2 years ago

https://github.com/rasmushaugaard/surfemb/blob/53e1852433a3b2b84fedc7a3a01674fe1b6189cc/surfemb/scripts/misc/surface_samples_remesh_visible.py#L39 ms.save_current_mesh(str(remesh_fp.absolute()), save_textures=False, binary=False)