Skip to content

Commit

Permalink
update config
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinXu02 committed Dec 18, 2024
1 parent 0715323 commit 55001e4
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions nerfstudio/configs/method_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
strategy="mcmc",
mcmc_opacity_reg=0.01,
mcmc_scale_reg=0.01,
stop_split_at=25000,
),
),
optimizers={
Expand Down
13 changes: 10 additions & 3 deletions nerfstudio/data/dataparsers/colmap_dataparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,17 @@ def _generate_dataparser_outputs(self, split: str = "train", **kwargs):
if not colmap_path.exists():
# Try detecting the colmap path automatically
possible_colmap_paths = ["colmap/sparse/0", "sparse/0", "sparse"]
for colmap_path in possible_colmap_paths:
colmap_path = self.config.data / colmap_path
for path in possible_colmap_paths:
colmap_path = self.config.data / path
if colmap_path.exists():
break
from rich.prompt import Confirm

if Confirm.ask(
f"Detected colmap path {colmap_path}. Do you want to use this path?"
):
self.config.colmap_path = path
break

assert colmap_path.exists(), f"Colmap path {colmap_path} does not exist."

meta = self._get_all_images_and_cameras(colmap_path)
Expand Down
14 changes: 4 additions & 10 deletions nerfstudio/models/splatfacto.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,10 @@ class SplatfactoModelConfig(ModelConfig):
"""If True, apply color correction to the rendered images before computing the metrics."""
strategy: Literal["default", "mcmc"] = "default"
"""The default strategy will be used if strategy is not specified. Other strategies, e.g. mcmc, can be used."""
cap_max: int = 1_000_000
max_gs_num: int = 1_000_000
"""Maximum number of GSs. Default to 1_000_000."""
noise_lr: float = 5e5
"""MCMC samping noise learning rate. Default to 5e5."""
min_opacity: float = 0.005
"""GSs with opacity below this value will be pruned. Default to 0.005."""
verbose: bool = False
"""Whether to print verbose information. Default to False."""
max_steps: int = 30_000
"""Number of training steps"""
mcmc_opacity_reg: float = 0.01
"""Regularization term for opacity in MCMC strategy. Only enabled when using MCMC strategy"""
mcmc_scale_reg: float = 0.01
Expand Down Expand Up @@ -287,13 +281,13 @@ def populate_modules(self):
self.strategy_state = self.strategy.initialize_state(scene_scale=1.0)
elif self.config.strategy == "mcmc":
self.strategy = MCMCStrategy(
cap_max=self.config.cap_max,
cap_max=self.config.max_gs_num,
noise_lr=self.config.noise_lr,
refine_start_iter=self.config.warmup_length,
refine_stop_iter=self.config.stop_split_at,
refine_every=self.config.refine_every,
min_opacity=self.config.min_opacity,
verbose=self.config.verbose,
min_opacity=self.config.cull_alpha_thresh,
verbose=False,
)
self.strategy_state = self.strategy.initialize_state()
else:
Expand Down

0 comments on commit 55001e4

Please sign in to comment.