Closed jloveric closed 8 months ago
Your OBJ file contains a lot of polygonal faces with more than 3 vertices. PyTorch3D doesn't support them and has to subdivide them into triangles, and it makes an assumption about order when doing so. See https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/io/obj_io.py#L126 . I wonder if that assumption isn't valid for your data. I can't think of anything else.
Thanks! That's probably the issue. I'll see if I can fix the problem with some preprocessing.
Just verified that triangulating all faces in blender and then exporting to obj solved this issue.
I have a model obj exported from blender. When I load that obj and immediately save it with pytorch3d save/load the resulting obj is missing or has some additional triangles added. I'm not sure what, but the resulting model visualized in blender is slightly incorrect. I'm not seeing any errors
🐛 Bugs / Unexpected behaviors
Instructions To Reproduce the Issue:
The script to reproduce is the following, where some.obj is a file we have. So also curious if others have seen an issue like this.
original.txt ( I added the .txt extension to the obj file so I could upload to github)
The right obj is the original, the left is that produced by the above script. In the left image there are extra triangles at the base which prevent you from seeing through the object. Same issue with a bunch of other files (extra triangles). No .mtl file in either.
Any changes you made (
git diff
) or code you wrote I'm using pytorch3d = "0.7.6+pt2.0.1cu117"The exact command(s) you ran: I just ran the script above on the command line with the given file
What you observed (including the full logs):
Please also simplify the steps as much as possible so they do not require additional resources to run, such as a private dataset.