simple-3dviz icon indicating copy to clipboard operation
simple-3dviz copied to clipboard

Loading OBJ file from ShapeNet fails

Open HanG-94 opened this issue 1 year ago • 3 comments

Hi simple-3dviz Team, when i try to load .obj file from ShapeNet using Mesh.from_file("model_normalized.obj") then gives following error:

File ~/miniconda3/lib/python3.10/site-packages/simple_3dviz/io/mesh.py:147, in ObjMeshReader.read..extract_uv(face) 146 def extract_uv(face): --> 147 return int(face.split("/")[1])-1

ValueError: invalid literal for int() with base 10: ''

The version of simple-3dviz is 0.7.0. The .obj file i list here: model_normalized.zip

could you please help me out?

Regards, Han Gao

HanG-94 avatar Mar 29 '23 07:03 HanG-94

Dear simple-3dviz Team,

i think the obj from ShapeNet.v2 consists of multiple models, which cannot be loaded by Mesh.from_file(). A possible workaround could be using the trimesh.load(file, force='mesh').

Regards, Han

HanG-94 avatar Mar 30 '23 10:03 HanG-94

Hi @HanG-94,

Thanks a lot for using our library. Do you mind sharing the obj file you that causes the ValueError?

Best, Despi

paschalidoud avatar Mar 30 '23 15:03 paschalidoud