read_obj returns a face list of size 1 x 3 * n_faces, instead of 3 x n_faces
See original GitHub issue🐛 Bug
When using read_obj
from torch_geometric.io
to load an obj file, the face
field of the returned data
object is of size 1 x 3 * n_faces
instead of 3 x n_faces
. This was not yet the case in v. 1.4.3.
To Reproduce
Steps to reproduce the behavior:
- Load obj file with
torch_geometric.io.read_obj
print(data.face.size())
- output:
torch.Size([1, n_faces * 3])
(in this case [1, 1500])
Expected behavior
output: torch.Size([3, n_faces])
. This is correct for read_ply
.
Environment
- OS: Linux (Ubuntu 20.04.1)
- Python version: 3.7.4
- PyTorch version: 1.6.0
- CUDA/cuDNN version: 10.2
- GCC version: 9.3.0
- Any other relevant information: PyG version: 1.6.1
Additional context
I’m investigating the cause and will submit a pull request when I’ve fixed the issue.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
readobj source: R/loadobj.R
Read a Wavefront OBJ 3D scene file into an R list #' #' @param f Path to an OBJ file #' @param materialspath...
Read more >readObj - File Exchange - MATLAB Central
This function reads vertices, faces, texture and normal information from a specified Obj file, and stores the information in a Matlab structure.
Read more >trimesh/obj.py at main
Python library for loading and using triangular meshes. - trimesh/obj.py at main ... now we have clean- ish faces grouped by material and...
Read more >Simple .obj mesh reader for MATLAB « Alec's Web Log
I wrote a little .obj file format reader in MATLAB. It only reads the vertices and faces of a triangle mesh (ignoring all...
Read more >Python read obj
def read_obj(in_file): vertices = [] faces = [] for k, v in yield_file(in_file): if k == 'v': vertices.append(v) elif k == 'f': for...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for this issue and your valuable bug tracing. This is very helpful! I fixed the code by using
t.split("/")[0]
. For later releases, we can think of using an external library to allow for faster loading and less code maintenance.I’m closing this issue for now, feel free to re-open in case there are any other concerns.
Ok, I reverted to the old version for now 😃