fix for scannet dataset camera pose loading (#2056)

* fix scannet dataparser pose issue

* camera pose corrected
This commit is contained in:
Weihang Li authored and GitHub committed 2023-06-10 09:07:57 -07:00
1 parent e2e5637d05
commit f2fdd10d9b
1 file changed
+4 -4
@@ -89,10 +89,10 @@ class ScanNet(DataParser):
K = np.loadtxt(self.config.data / "intrinsic" / "intrinsic_color.txt")
for img, depth, pose in zip(img_dir_sorted, depth_dir_sorted, pose_dir_sorted):
pose = np.loadtxt(pose)
pose[0:3, 1:3] *= -1
pose = pose[np.array([1, 0, 2, 3]), :]
pose[2, :] *= -1
pose = np.array(pose).reshape(4, 4)
pose[:3, 1] *= -1
pose[:3, 2] *= -1
pose = torch.from_numpy(pose).float()
# We cannot accept files directly, as some of the poses are invalid
if np.isinf(pose).any():
continue