thodan / bop_toolkit

A Python toolkit of the BOP benchmark for 6D object pose estimation.
http://bop.felk.cvut.cz
MIT License
415 stars 140 forks source link

while visualing est poses, tless models' are not uploaded #90

Open smoothumut opened 1 year ago

smoothumut commented 1 year ago

Hi thanks for your great work. While trying to run vis_est_poses.py it gives error. in renderer_vispy.py file, the line 402 below gives the error. because the model doesnt have "normals" key and values

    vertices = np.array(list(zip(model["pts"], model["normals"], colors, texture_uv)), vertices_type)

what am I missing, thanks in advance

thodan commented 1 year ago

What model are you using?

smoothumut commented 1 year ago

Hi Thodan, thanks for your reply. I am using tless models if that is what you are asking

thodan commented 1 year ago

Please have a look exactly what PLY file (containing the object model) is loaded. All PLY files from the T-LESS dataset include the surface normals (saved as items nx, ny and nz), so model["normals"] should be defined.

SajjadPSavoji commented 1 month ago

I am facing the same problem when trying to visualize gt pose for lmo. Did anybody figure out how to resolve this ? I got the ply models from huggingface, so don't really think the ply files are corrupted.

SajjadPSavoji commented 1 month ago

just for the sake of other people who will end up here, I am assuming that some of the models in some datasets do not have the normals. I implemented a temporary work-around that sets the shading to ''flat" for such cases. Also it is fixing the issue only with vispy, if you are using other renderers, it wont fix your problem.

modify renderer_vispy.py: line 425

try: vertices = np.array( list(zip(model["pts"], model["normals"], colors, texture_uv)), vertices_type, ) except: self.shading = "flat" vertices_type = [ ("a_position", np.float32, 3), ("a_color", np.float32, colors.shape[1]), ("a_texcoord", np.float32, 2), ] vertices = np.array( list(zip(model["pts"], colors, texture_uv)), vertices_type )