4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 10:34:29 +08:00

add correct none check to distortion params (#878)

* add none check

* black formatting
This commit is contained in:
Nikhil Mohan 2022-11-02 17:20:26 +00:00 committed by GitHub
parent c53df92b9c
commit 6f158a3e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -420,7 +420,7 @@ class Cameras:
self.cy[indices],
height=self._image_heights[indices],
width=self._image_widths[indices],
distortion_params=self.distortion_params[indices] if self.distortion_params else None,
distortion_params=self.distortion_params[indices] if self.distortion_params is not None else None,
camera_type=self.camera_type[indices],
)
if isinstance(indices, (int, slice)):
@ -433,6 +433,8 @@ class Cameras:
self.cy[indices + (slice(None),)],
height=self._image_heights[indices + (slice(None),)],
width=self._image_widths[indices + (slice(None),)],
distortion_params=self.distortion_params[indices + (slice(None),)] if self.distortion_params else None,
distortion_params=self.distortion_params[indices + (slice(None),)]
if self.distortion_params is not None
else None,
camera_type=self.camera_type[indices + (slice(None),)],
)