mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-07 00:09:14 +08:00
1 parent
08aaa8b3a5
commit
297950f7ec
2 files changed
+8
-6
No files matched your search
@@ -401,7 +401,7 @@ class Cameras:
|
|||||||
scaling_factor: Scaling factor to apply to the output resolution.
|
scaling_factor: Scaling factor to apply to the output resolution.
|
||||||
"""
|
"""
|
||||||
if isinstance(scaling_factor, float):
|
if isinstance(scaling_factor, float):
|
||||||
scaling_factor = torch.tensor([scaling_factor]).broadcast_to((self.size))
|
scaling_factor = torch.tensor([scaling_factor]).to(self.device).broadcast_to((self.size))
|
||||||
|
|
||||||
self.fx = self.fx * scaling_factor
|
self.fx = self.fx * scaling_factor
|
||||||
self.fy = self.fy * scaling_factor
|
self.fy = self.fy * scaling_factor
|
||||||
|
|||||||
@@ -141,13 +141,15 @@ class EvalDataloader(DataLoader):
|
|||||||
distortion_params = self.cameras.distortion_params[image_idx]
|
distortion_params = self.cameras.distortion_params[image_idx]
|
||||||
|
|
||||||
camera = Cameras(
|
camera = Cameras(
|
||||||
fx=self.cameras.fx if isinstance(self.cameras.fx, float) else self.cameras.fx[image_idx : image_idx + 1],
|
fx=self.cameras.fx[image_idx : image_idx + 1],
|
||||||
fy=self.cameras.fy if isinstance(self.cameras.fy, float) else self.cameras.fy[image_idx : image_idx + 1],
|
fy=self.cameras.fy[image_idx : image_idx + 1],
|
||||||
cx=self.cameras.cx,
|
cx=self.cameras.cx[image_idx : image_idx + 1],
|
||||||
cy=self.cameras.cy,
|
cy=self.cameras.cy[image_idx : image_idx + 1],
|
||||||
|
height=self.cameras.image_height[image_idx : image_idx + 1],
|
||||||
|
width=self.cameras.image_width[image_idx : image_idx + 1],
|
||||||
camera_to_worlds=self.cameras.camera_to_worlds[image_idx : image_idx + 1],
|
camera_to_worlds=self.cameras.camera_to_worlds[image_idx : image_idx + 1],
|
||||||
distortion_params=distortion_params,
|
distortion_params=distortion_params,
|
||||||
camera_type=self.cameras.camera_type,
|
camera_type=self.cameras.camera_type[image_idx : image_idx + 1],
|
||||||
)
|
)
|
||||||
return camera
|
return camera
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user