mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-01 13:28:59 +08:00
fix for scannet dataset camera pose loading (#2056)
* fix scannet dataparser pose issue * camera pose corrected
This commit is contained in:
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")
|
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):
|
for img, depth, pose in zip(img_dir_sorted, depth_dir_sorted, pose_dir_sorted):
|
||||||
pose = np.loadtxt(pose)
|
pose = np.loadtxt(pose)
|
||||||
pose[0:3, 1:3] *= -1
|
pose = np.array(pose).reshape(4, 4)
|
||||||
pose = pose[np.array([1, 0, 2, 3]), :]
|
pose[:3, 1] *= -1
|
||||||
pose[2, :] *= -1
|
pose[:3, 2] *= -1
|
||||||
|
pose = torch.from_numpy(pose).float()
|
||||||
# We cannot accept files directly, as some of the poses are invalid
|
# We cannot accept files directly, as some of the poses are invalid
|
||||||
if np.isinf(pose).any():
|
if np.isinf(pose).any():
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in new issue
Block a user