Skip to content

Commit

Permalink
Use max resolution when not moving or training (#1091)
Browse files Browse the repository at this point in the history
use max resolution when not moving or training
  • Loading branch information
machenmusik authored Dec 6, 2022
1 parent 2a62d8a commit f3442c8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nerfstudio/viewer/server/viewer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,12 @@ def _calculate_image_res(self, camera_object, is_training: bool) -> Optional[Tup

aspect_ratio = camera_object["aspect"]

image_height = (num_vis_rays / aspect_ratio) ** 0.5
image_height = int(round(image_height, -1))
image_height = min(self.max_resolution, image_height)
if not self.camera_moving and not is_training:
image_height = self.max_resolution
else:
image_height = (num_vis_rays / aspect_ratio) ** 0.5
image_height = int(round(image_height, -1))
image_height = min(self.max_resolution, image_height)
image_width = int(image_height * aspect_ratio)
if image_width > self.max_resolution:
image_width = self.max_resolution
Expand Down

0 comments on commit f3442c8

Please sign in to comment.