Skip to content

Commit 2fbf8f9

Browse files
committed
fix typing
1 parent b7012ac commit 2fbf8f9

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ RUN git clone --recursive https://github.com/cvg/pixel-perfect-sfm.git && \
141141
# Install waymo-open-dataset
142142
RUN python3.10 -m pip install --no-cache-dir waymo-open-dataset-tf-2-11-0==1.6.1
143143

144+
# Install tzdata
145+
RUN python3.10 -m pip install --no-cache-dir tzdata
146+
144147
# Copy nerfstudio folder.
145148
ADD . /nerfstudio
146149

nerfstudio/cameras/camera_optimizers.py

+15-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class CameraOptimizerConfig(InstantiateConfig):
4747
mode: Literal["off", "SO3xR3", "SE3"] = "off"
4848
"""Pose optimization strategy to use. If enabled, we recommend SO3xR3."""
4949

50-
trans_l2_penalty: float = 1e-2
50+
trans_l2_penalty: Union[Tuple, float] = 1e-2
5151
"""L2 penalty on translation parameters."""
5252

5353
rot_l2_penalty: float = 1e-3
@@ -206,9 +206,20 @@ class ScaledCameraOptimizerConfig(CameraOptimizerConfig):
206206

207207
_target: Type = field(default_factory=lambda: ScaledCameraOptimizer)
208208

209-
weights: Tuple[float, float, float, float, float, float] = (1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
210-
211-
trans_l2_penalty: Tuple[float, float, float] = (1e-2, 1e-2, 1e-2) # TODO: this is l1
209+
weights: Tuple[float, float, float, float, float, float] = (
210+
1.0,
211+
1.0,
212+
1.0,
213+
1.0,
214+
1.0,
215+
1.0,
216+
)
217+
218+
trans_l2_penalty: Union[Tuple[float, float, float], float] = (
219+
1e-2,
220+
1e-2,
221+
1e-2,
222+
) # TODO: this is l1
212223

213224

214225
class ScaledCameraOptimizer(CameraOptimizer):

nerfstudio/configs/method_configs.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,11 @@
360360
method_configs["neurad-scaleopt"].method_name = "neurad-scaleopt"
361361
method_configs["neurad-scaleopt"].pipeline.model.camera_optimizer = ScaledCameraOptimizerConfig(
362362
weights=(1.0, 1.0, 0.01, 0.01, 0.01, 1.0), # xrot, yrot, zrot, xtrans, ytrans, ztrans
363-
trans_l2_penalty=(1e-2, 1e-2, 1e-3), # x, y, z
363+
trans_l2_penalty=(
364+
1e-2,
365+
1e-2,
366+
1e-3,
367+
), # x, y, z
364368
mode="SO3xR3",
365369
)
366370

@@ -397,7 +401,11 @@ def _scaled_neurad_training(config: TrainerConfig, scale: float, newname: str) -
397401
method_configs["neurader-scaleopt"].method_name = "neurader-scaleopt"
398402
method_configs["neurader-scaleopt"].pipeline.model.camera_optimizer = ScaledCameraOptimizerConfig(
399403
weights=(1.0, 1.0, 0.01, 0.01, 0.01, 1.0), # xrot, yrot, -zrot-, -xtrans-, -ytrans-, ztrans
400-
trans_l2_penalty=(1e-2, 1e-2, 1e-3), # x, y, z
404+
trans_l2_penalty=(
405+
1e-2,
406+
1e-2,
407+
1e-3,
408+
), # x, y, z
401409
mode="SO3xR3",
402410
)
403411

@@ -463,4 +471,4 @@ def sort_methods(methods, method_descriptions):
463471
]
464472
"""Union[] type over config types, annotated with default instances for use with
465473
tyro.cli(). Allows the user to pick between one of several base configurations, and
466-
then override values in it."""
474+
then override values in it."""

0 commit comments

Comments
 (0)