mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 02:24:38 +08:00
fix test
This commit is contained in:
parent
97c411ea52
commit
74bb54ebd1
@ -657,7 +657,7 @@ class Cameras(TensorDataclass):
|
||||
coord_stack[coord_mask, :].reshape(3, -1, 2),
|
||||
distortion_params[mask, :],
|
||||
).reshape(-1, 2)
|
||||
except ImportError:
|
||||
except (RuntimeError, ImportError):
|
||||
coord_stack[coord_mask, :] = camera_utils.radial_and_tangential_undistort(
|
||||
coord_stack[coord_mask, :].reshape(3, -1, 2),
|
||||
distortion_params[mask, :],
|
||||
|
||||
@ -39,7 +39,7 @@ CX_YS = [
|
||||
torch.ones(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 = [
|
||||
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.height.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)
|
||||
return True
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user