Skip to content

Commit

Permalink
Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi committed Jan 20, 2024
1 parent 5bc7f79 commit cad244f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions nerfstudio/cameras/cameras.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions nerfstudio/models/generfacto.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion nerfstudio/scripts/blender/nerfstudio_blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cad244f

Please sign in to comment.