4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 02:24:38 +08:00

Fix camera rounding bug (#816)

fix rounding bug
This commit is contained in:
Matthew Tancik 2022-10-20 16:31:07 -07:00 committed by GitHub
parent 6f4fb506e2
commit 4c62a05415
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ class Cameras:
h_w = h_w.to(torch.int64).to(self.device).broadcast_to((self._num_cameras))
assert torch.all(h_w == h_w[0]), "Batched cameras of different types will be allowed in the future."
elif h_w is None:
h_w = torch.Tensor(c_x_y.to(torch.int64).to(self.device) * 2).broadcast_to((self._num_cameras))
h_w = torch.Tensor((c_x_y * 2).to(torch.int64).to(self.device)).broadcast_to((self._num_cameras))
else:
raise ValueError("Height must be an int, tensor, or None, received: " + str(type(h_w)))
return h_w