PLY with uint face data (#1104)

Summary: Fix assumption that face indices are signed in the PLY file, as reported in #1104.

Reviewed By: nikhilaravi

Differential Revision: D34892598

fbshipit-source-id: a8b23bfac1357bdc11bbbf752098319142239804
This commit is contained in:
Jeremy Reizenstein
2022-03-16 05:42:34 -07:00
committed by Facebook GitHub Bot
parent 1701b76a31
commit 9b5a3ffa6c
2 changed files with 40 additions and 1 deletions

View File

@@ -1040,7 +1040,7 @@ def _load_ply(f, *, path_manager: PathManager) -> _PlyData:
if face.shape[1] < 3:
raise ValueError("Faces must have at least 3 vertices.")
face_arrays = [face[:, [0, i + 1, i + 2]] for i in range(face.shape[1] - 2)]
faces = torch.LongTensor(np.vstack(face_arrays))
faces = torch.LongTensor(np.vstack(face_arrays).astype(np.int64))
else:
face_list = []
for face_item in face: