This commit is contained in:
Ruilong Li committed 2023-04-09 11:16:33 +00:00
1 parent 97c411ea52
commit 74bb54ebd1
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -657,7 +657,7 @@ class Cameras(TensorDataclass):
coord_stack[coord_mask, :].reshape(3, -1, 2), coord_stack[coord_mask, :].reshape(3, -1, 2),
distortion_params[mask, :], distortion_params[mask, :],
).reshape(-1, 2) ).reshape(-1, 2)
except ImportError: except (RuntimeError, ImportError):
coord_stack[coord_mask, :] = camera_utils.radial_and_tangential_undistort( coord_stack[coord_mask, :] = camera_utils.radial_and_tangential_undistort(
coord_stack[coord_mask, :].reshape(3, -1, 2), coord_stack[coord_mask, :].reshape(3, -1, 2),
distortion_params[mask, :], distortion_params[mask, :],
+2 -2
View File
@@ -39,7 +39,7 @@ CX_YS = [
torch.ones(BATCH_SIZE, 1) * CX_Y, torch.ones(BATCH_SIZE, 1) * CX_Y,
torch.ones((BATCH_SIZE, BATCH_SIZE, 1)) * CX_Y, torch.ones((BATCH_SIZE, BATCH_SIZE, 1)) * CX_Y,
] ]
DISTORTION_PARAMS = [None, torch.zeros(6), torch.zeros((BATCH_SIZE, 6)), torch.zeros((BATCH_SIZE, BATCH_SIZE, 6))] DISTORTION_PARAMS = [None, torch.zeros(8), torch.zeros((BATCH_SIZE, 8)), torch.zeros((BATCH_SIZE, BATCH_SIZE, 8))]
camera_types = [ camera_types = [
1, 1,
torch.tensor([1]), torch.tensor([1]),
@@ -303,7 +303,7 @@ def _check_cam_shapes(cam: Cameras, _batch_size):
assert cam.cy.shape == (*_batch_size, 1) assert cam.cy.shape == (*_batch_size, 1)
assert cam.height.shape == (*_batch_size, 1) assert cam.height.shape == (*_batch_size, 1)
assert cam.width.shape == (*_batch_size, 1) assert cam.width.shape == (*_batch_size, 1)
assert cam.distortion_params is None or cam.distortion_params.shape == (*_batch_size, 6) assert cam.distortion_params is None or cam.distortion_params.shape == (*_batch_size, 8)
assert cam.camera_type.shape == (*_batch_size, 1) assert cam.camera_type.shape == (*_batch_size, 1)
return True return True