mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
specify a viewers list (#574)
* viewer list * before master merge * update script
This commit is contained in:
1 parent
c733d1a4ed
commit
43d588f35f
8 files changed
+55
-39
No files matched your search
@@ -17,7 +17,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from dataclasses import dataclass
|
||||
from dataclasses import dataclass, field
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List, Literal, Optional, Tuple, Type
|
||||
@@ -118,8 +118,6 @@ class LoggingConfig(PrintableConfig):
|
||||
max_buffer_size: int = 20
|
||||
"""maximum history size to keep for computing running averages of stats.
|
||||
e.g. if 20, averages will be computed over past 20 occurances."""
|
||||
event_writer: Literal["tb", "wandb", "none"] = "wandb"
|
||||
"""specify which writer to use (tensorboard or wandb)"""
|
||||
local_writer: LocalWriterConfig = LocalWriterConfig(enable=True)
|
||||
"""if provided, will print stats locally. if None, will disable printing"""
|
||||
enable_profiler: bool = True
|
||||
@@ -154,7 +152,6 @@ class TrainerConfig(PrintableConfig):
|
||||
load_step: Optional[int] = None
|
||||
"""optionally specify model step to load from; if none, will find most recent model in load_dir"""
|
||||
load_config: Optional[Path] = None
|
||||
"""optionally specify a pre-defined config to load from"""
|
||||
|
||||
|
||||
# Viewer related configs
|
||||
@@ -162,8 +159,6 @@ class TrainerConfig(PrintableConfig):
|
||||
class ViewerConfig(PrintableConfig):
|
||||
"""Configuration for viewer instantiation"""
|
||||
|
||||
enable: bool = False
|
||||
"""whether to enable viewer"""
|
||||
relative_log_filename: str = "viewer_log_filename.txt"
|
||||
"""Filename to use for the log file."""
|
||||
start_train: bool = True
|
||||
@@ -255,6 +250,20 @@ class Config(PrintableConfig):
|
||||
}
|
||||
}
|
||||
)
|
||||
"""optionally specify a pre-defined config to load from"""
|
||||
vis: List[Literal["viewer", "wandb", "tensorboard"]] = field(default_factory=lambda: ["wandb"])
|
||||
|
||||
def is_viewer_enabled(self) -> bool:
|
||||
"""Checks if a viewer is enabled."""
|
||||
return "viewer" in self.vis
|
||||
|
||||
def is_wandb_enabled(self) -> bool:
|
||||
"""Checks if wandb is enabled."""
|
||||
return "wandb" in self.vis
|
||||
|
||||
def is_tensorboard_enabled(self) -> bool:
|
||||
"""Checks if tensorboard is enabled."""
|
||||
return "tensorboard" in self.vis
|
||||
|
||||
def set_timestamp(self) -> None:
|
||||
"""Dynamically set the experiment timestamp"""
|
||||
|
||||
@@ -25,7 +25,6 @@ import dcargs
|
||||
from nerfactory.configs.base import (
|
||||
AdamOptimizerConfig,
|
||||
Config,
|
||||
LoggingConfig,
|
||||
RAdamOptimizerConfig,
|
||||
SchedulerConfig,
|
||||
TrainerConfig,
|
||||
@@ -64,8 +63,7 @@ base_configs["compound"] = Config(
|
||||
"scheduler": None,
|
||||
}
|
||||
},
|
||||
viewer=ViewerConfig(enable=True),
|
||||
logging=LoggingConfig(event_writer="none"),
|
||||
vis=["viewer"],
|
||||
)
|
||||
|
||||
base_configs["instant-ngp"] = Config(
|
||||
@@ -81,8 +79,7 @@ base_configs["instant-ngp"] = Config(
|
||||
"scheduler": None,
|
||||
}
|
||||
},
|
||||
viewer=ViewerConfig(enable=True),
|
||||
logging=LoggingConfig(event_writer="none"),
|
||||
vis=["viewer"],
|
||||
)
|
||||
|
||||
base_configs["proposal"] = Config(
|
||||
@@ -104,8 +101,8 @@ base_configs["proposal"] = Config(
|
||||
"scheduler": None,
|
||||
},
|
||||
},
|
||||
viewer=ViewerConfig(enable=True, num_rays_per_chunk=2 << 15),
|
||||
logging=LoggingConfig(event_writer="none"),
|
||||
viewer=ViewerConfig(num_rays_per_chunk=2 << 15),
|
||||
vis=["viewer"],
|
||||
)
|
||||
|
||||
base_configs["mipnerf-360"] = Config(
|
||||
|
||||
Reference in new issue
Block a user