From 4c62a0541560c6d9c5cd2eb241d20b01ac708e01 Mon Sep 17 00:00:00 2001 From: Matthew Tancik Date: Thu, 20 Oct 2022 16:31:07 -0700 Subject: [PATCH] Fix camera rounding bug (#816) fix rounding bug --- nerfstudio/cameras/cameras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/cameras/cameras.py b/nerfstudio/cameras/cameras.py index 66afba2f1..8d66e3ae4 100644 --- a/nerfstudio/cameras/cameras.py +++ b/nerfstudio/cameras/cameras.py @@ -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