mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 10:34:29 +08:00
parent
08aaa8b3a5
commit
297950f7ec
@ -401,7 +401,7 @@ class Cameras:
|
||||
scaling_factor: Scaling factor to apply to the output resolution.
|
||||
"""
|
||||
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.fy = self.fy * scaling_factor
|
||||
|
||||
@ -141,13 +141,15 @@ class EvalDataloader(DataLoader):
|
||||
distortion_params = self.cameras.distortion_params[image_idx]
|
||||
|
||||
camera = Cameras(
|
||||
fx=self.cameras.fx if isinstance(self.cameras.fx, float) else 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],
|
||||
cx=self.cameras.cx,
|
||||
cy=self.cameras.cy,
|
||||
fx=self.cameras.fx[image_idx : image_idx + 1],
|
||||
fy=self.cameras.fy[image_idx : image_idx + 1],
|
||||
cx=self.cameras.cx[image_idx : image_idx + 1],
|
||||
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],
|
||||
distortion_params=distortion_params,
|
||||
camera_type=self.cameras.camera_type,
|
||||
camera_type=self.cameras.camera_type[image_idx : image_idx + 1],
|
||||
)
|
||||
return camera
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user