From cad244f11376101185acaabc8c647ba27f65b7f3 Mon Sep 17 00:00:00 2001 From: Brent Yi Date: Fri, 19 Jan 2024 16:19:12 -0800 Subject: [PATCH] Ruff --- nerfstudio/cameras/cameras.py | 4 ++-- nerfstudio/models/generfacto.py | 16 ++++++++++++---- nerfstudio/scripts/blender/nerfstudio_blender.py | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/nerfstudio/cameras/cameras.py b/nerfstudio/cameras/cameras.py index 3086298e2c..f81323b45b 100644 --- a/nerfstudio/cameras/cameras.py +++ b/nerfstudio/cameras/cameras.py @@ -670,7 +670,7 @@ def _generate_rays_from_coords( assert c2w.shape == num_rays_shape + (3, 4) def _compute_rays_for_omnidirectional_stereo( - eye: Literal["left", "right"] + eye: Literal["left", "right"], ) -> Tuple[Float[Tensor, "num_rays_shape 3"], Float[Tensor, "3 num_rays_shape 3"]]: """Compute the rays for an omnidirectional stereo camera @@ -727,7 +727,7 @@ def _compute_rays_for_omnidirectional_stereo( return ods_origins_circle, directions_stack def _compute_rays_for_vr180( - eye: Literal["left", "right"] + eye: Literal["left", "right"], ) -> Tuple[Float[Tensor, "num_rays_shape 3"], Float[Tensor, "3 num_rays_shape 3"]]: """Compute the rays for a VR180 camera diff --git a/nerfstudio/models/generfacto.py b/nerfstudio/models/generfacto.py index c07f904c7d..a935c4f0c2 100644 --- a/nerfstudio/models/generfacto.py +++ b/nerfstudio/models/generfacto.py @@ -275,22 +275,30 @@ def get_training_callbacks( ) -> List[TrainingCallback]: # the callback that we want to run every X iterations after the training iteration def taper_density( - self, training_callback_attributes: TrainingCallbackAttributes, step: int # pylint: disable=unused-argument + self, + training_callback_attributes: TrainingCallbackAttributes, + step: int, # pylint: disable=unused-argument ): self.density_strength = np.interp(step, self.config.taper_range, self.config.taper_strength) def start_training_normals( - self, training_callback_attributes: TrainingCallbackAttributes, step: int # pylint: disable=unused-argument + self, + training_callback_attributes: TrainingCallbackAttributes, + step: int, # pylint: disable=unused-argument ): self.train_normals = True def start_shaded_training( - self, training_callback_attributes: TrainingCallbackAttributes, step: int # pylint: disable=unused-argument + self, + training_callback_attributes: TrainingCallbackAttributes, + step: int, # pylint: disable=unused-argument ): self.train_shaded = True def update_orientation_loss_mult( - self, training_callback_attributes: TrainingCallbackAttributes, step: int # pylint: disable=unused-argument + self, + training_callback_attributes: TrainingCallbackAttributes, + step: int, # pylint: disable=unused-argument ): if step <= self.config.start_normals_training: self.orientation_loss_mult = 0 diff --git a/nerfstudio/scripts/blender/nerfstudio_blender.py b/nerfstudio/scripts/blender/nerfstudio_blender.py index c5f6e32515..c079a6b2a4 100644 --- a/nerfstudio/scripts/blender/nerfstudio_blender.py +++ b/nerfstudio/scripts/blender/nerfstudio_blender.py @@ -135,7 +135,7 @@ def construct_json_obj(self): render_seconds = 1 / render_fps else: render_seconds = ( - ((bpy.context.scene.frame_end - bpy.context.scene.frame_start) // (bpy.context.scene.frame_step) + 1) + (bpy.context.scene.frame_end - bpy.context.scene.frame_start) // (bpy.context.scene.frame_step) + 1 ) / render_fps smoothness_value = 0