Configs#

Base Configs

class nerfstudio.configs.base_config.Config(output_dir: ~pathlib.Path = PosixPath('outputs'), method_name: ~typing.Optional[str] = None, experiment_name: ~typing.Optional[str] = None, timestamp: str = '{timestamp}', machine: ~nerfstudio.configs.base_config.MachineConfig = MachineConfig(seed=42, num_gpus=1, num_machines=1, machine_rank=0, dist_url='auto'), logging: ~nerfstudio.configs.base_config.LoggingConfig = LoggingConfig(relative_log_dir=PosixPath('.'), steps_per_log=10, max_buffer_size=20, local_writer=LocalWriterConfig(_target=<class 'nerfstudio.utils.writer.LocalWriter'>, enable=True, stats_to_track=(<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>), max_log_size=10), enable_profiler=True), viewer: ~nerfstudio.configs.base_config.ViewerConfig = ViewerConfig(relative_log_filename='viewer_log_filename.txt', start_train=True, zmq_port=None, launch_bridge_server=True, websocket_port=7007, ip_address='127.0.0.1', num_rays_per_chunk=32768, max_num_display_images=512, quit_on_train_completion=False, skip_openrelay=False), trainer: ~nerfstudio.configs.base_config.TrainerConfig = TrainerConfig(steps_per_save=1000, steps_per_eval_batch=500, steps_per_eval_image=500, steps_per_eval_all_images=25000, max_num_iterations=1000000, mixed_precision=False, relative_model_dir=PosixPath('nerfstudio_models'), save_only_latest_checkpoint=True, load_dir=None, load_step=None, load_config=None), pipeline: ~nerfstudio.pipelines.base_pipeline.VanillaPipelineConfig = VanillaPipelineConfig(_target=<class 'nerfstudio.pipelines.base_pipeline.VanillaPipeline'>, datamanager=VanillaDataManagerConfig(_target=<class 'nerfstudio.data.datamanagers.base_datamanager.VanillaDataManager'>, dataparser=BlenderDataParserConfig(_target=<class 'nerfstudio.data.dataparsers.blender_dataparser.Blender'>, data=PosixPath('data/blender/lego'), scale_factor=1.0, alpha_color='white'), train_num_rays_per_batch=1024, train_num_images_to_sample_from=-1, train_num_times_to_repeat_images=-1, eval_num_rays_per_batch=1024, eval_num_images_to_sample_from=-1, eval_num_times_to_repeat_images=-1, eval_image_indices=(0, ), camera_optimizer=CameraOptimizerConfig(_target=<class 'nerfstudio.cameras.camera_optimizers.CameraOptimizer'>, mode='off', position_noise_std=0.0, orientation_noise_std=0.0, optimizer=AdamOptimizerConfig(_target=<class 'torch.optim.adam.Adam'>, lr=0.0006, eps=1e-15, weight_decay=0), scheduler=SchedulerConfig(_target=<class 'nerfstudio.engine.schedulers.ExponentialDecaySchedule'>, lr_final=5e-06, max_steps=10000), param_group='camera_opt'), camera_res_scale_factor=1.0), model=ModelConfig(_target=<class 'nerfstudio.models.base_model.Model'>, enable_collider=True, collider_params={'near_plane': 2.0, 'far_plane': 6.0}, loss_coefficients={'rgb_loss_coarse': 1.0, 'rgb_loss_fine': 1.0}, eval_num_rays_per_chunk=4096)), optimizers: ~typing.Dict[str, ~typing.Any] = <factory>, vis: ~typing.Literal['viewer', 'wandb', 'tensorboard'] = 'wandb', data: ~typing.Optional[~pathlib.Path] = None)#

Bases: PrintableConfig

Full config contents

data: Optional[Path] = None#

Alias for –pipeline.datamanager.dataparser.data

experiment_name: Optional[str] = None#

Experiment name. If None, will automatically be set to dataset name

get_base_dir() Path#

Retrieve the base directory to set relative paths

get_checkpoint_dir() Path#

Retrieve the checkpoint directory

is_tensorboard_enabled() bool#

Checks if tensorboard is enabled.

is_viewer_enabled() bool#

Checks if a viewer is enabled.

is_wandb_enabled() bool#

Checks if wandb is enabled.

logging: LoggingConfig = LoggingConfig(relative_log_dir=PosixPath('.'), steps_per_log=10, max_buffer_size=20, local_writer=LocalWriterConfig(_target=<class 'nerfstudio.utils.writer.LocalWriter'>, enable=True, stats_to_track=(<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>), max_log_size=10), enable_profiler=True)#

Logging configuration

machine: MachineConfig = MachineConfig(seed=42, num_gpus=1, num_machines=1, machine_rank=0, dist_url='auto')#

Machine configuration

method_name: Optional[str] = None#

Method name. Required to set in python or via cli

optimizers: Dict[str, Any]#

Dictionary of optimizer groups and their schedulers

output_dir: Path = PosixPath('outputs')#

relative or absolute output directory to save all checkpoints and logging

pipeline: VanillaPipelineConfig = VanillaPipelineConfig(_target=<class 'nerfstudio.pipelines.base_pipeline.VanillaPipeline'>, datamanager=VanillaDataManagerConfig(_target=<class 'nerfstudio.data.datamanagers.base_datamanager.VanillaDataManager'>, dataparser=BlenderDataParserConfig(_target=<class 'nerfstudio.data.dataparsers.blender_dataparser.Blender'>, data=PosixPath('data/blender/lego'), scale_factor=1.0, alpha_color='white'), train_num_rays_per_batch=1024, train_num_images_to_sample_from=-1, train_num_times_to_repeat_images=-1, eval_num_rays_per_batch=1024, eval_num_images_to_sample_from=-1, eval_num_times_to_repeat_images=-1, eval_image_indices=(0,), camera_optimizer=CameraOptimizerConfig(_target=<class 'nerfstudio.cameras.camera_optimizers.CameraOptimizer'>, mode='off', position_noise_std=0.0, orientation_noise_std=0.0, optimizer=AdamOptimizerConfig(_target=<class 'torch.optim.adam.Adam'>, lr=0.0006, eps=1e-15, weight_decay=0), scheduler=SchedulerConfig(_target=<class 'nerfstudio.engine.schedulers.ExponentialDecaySchedule'>, lr_final=5e-06, max_steps=10000), param_group='camera_opt'), camera_res_scale_factor=1.0), model=ModelConfig(_target=<class 'nerfstudio.models.base_model.Model'>, enable_collider=True, collider_params={'near_plane': 2.0, 'far_plane': 6.0}, loss_coefficients={'rgb_loss_coarse': 1.0, 'rgb_loss_fine': 1.0}, eval_num_rays_per_chunk=4096))#

Pipeline configuration

print_to_terminal() None#

Helper to pretty print config to terminal

save_config() None#

Save config to base directory

set_experiment_name() None#

Dynamically set the experiment name

set_timestamp() None#

Dynamically set the experiment timestamp

timestamp: str = '{timestamp}'#

Experiment timestamp.

trainer: TrainerConfig = TrainerConfig(steps_per_save=1000, steps_per_eval_batch=500, steps_per_eval_image=500, steps_per_eval_all_images=25000, max_num_iterations=1000000, mixed_precision=False, relative_model_dir=PosixPath('nerfstudio_models'), save_only_latest_checkpoint=True, load_dir=None, load_step=None, load_config=None)#

Trainer configuration

viewer: ViewerConfig = ViewerConfig(relative_log_filename='viewer_log_filename.txt', start_train=True, zmq_port=None, launch_bridge_server=True, websocket_port=7007, ip_address='127.0.0.1', num_rays_per_chunk=32768, max_num_display_images=512, quit_on_train_completion=False, skip_openrelay=False)#

Viewer configuration

vis: Literal['viewer', 'wandb', 'tensorboard'] = 'wandb'#

Which visualizer to use.

class nerfstudio.configs.base_config.InstantiateConfig(_target: Type)#

Bases: PrintableConfig

Config class for instantiating an the class specified in the _target attribute.

setup(**kwargs) Any#

Returns the instantiated object using the config.

class nerfstudio.configs.base_config.LocalWriterConfig(_target: ~typing.Type = <class 'nerfstudio.utils.writer.LocalWriter'>, enable: bool = False, stats_to_track: ~typing.Tuple[~nerfstudio.utils.writer.EventName, ...] = (<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>), max_log_size: int = 10)#

Bases: InstantiateConfig

Local Writer config

enable: bool = False#

if True enables local logging, else disables

max_log_size: int = 10#

maximum number of rows to print before wrapping. if 0, will print everything.

setup(banner_messages: Optional[List[str]] = None, **kwargs) Any#

Instantiate local writer

Parameters:

banner_messages – List of strings that always print at the bottom of screen.

stats_to_track: Tuple[EventName, ...] = (<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>)#

specifies which stats will be logged/printed to terminal

class nerfstudio.configs.base_config.LoggingConfig(relative_log_dir: ~pathlib.Path = PosixPath('.'), steps_per_log: int = 10, max_buffer_size: int = 20, local_writer: ~nerfstudio.configs.base_config.LocalWriterConfig = LocalWriterConfig(_target=<class 'nerfstudio.utils.writer.LocalWriter'>, enable=True, stats_to_track=(<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>), max_log_size=10), enable_profiler: bool = True)#

Bases: PrintableConfig

Configuration of loggers and profilers

enable_profiler: bool = True#

whether to enable profiling code; prints speed of functions at the end of a program. profiler logs run times of functions and prints at end of training

local_writer: LocalWriterConfig = LocalWriterConfig(_target=<class 'nerfstudio.utils.writer.LocalWriter'>, enable=True, stats_to_track=(<EventName.ITER_TRAIN_TIME: 'Train Iter (time)'>, <EventName.TRAIN_RAYS_PER_SEC: 'Train Rays / Sec'>, <EventName.CURR_TEST_PSNR: 'Test PSNR'>, <EventName.VIS_RAYS_PER_SEC: 'Vis Rays / Sec'>, <EventName.TEST_RAYS_PER_SEC: 'Test Rays / Sec'>), max_log_size=10)#

if provided, will print stats locally. if None, will disable printing

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.

relative_log_dir: Path = PosixPath('.')#

relative path to save all logged events

steps_per_log: int = 10#

number of steps between logging stats

class nerfstudio.configs.base_config.MachineConfig(seed: int = 42, num_gpus: int = 1, num_machines: int = 1, machine_rank: int = 0, dist_url: str = 'auto')#

Bases: PrintableConfig

Configuration of machine setup

dist_url: str = 'auto'#

distributed connection point (for DDP)

machine_rank: int = 0#

current machine’s rank (for DDP)

num_gpus: int = 1#

total number of gpus available for train/eval

num_machines: int = 1#

total number of distributed machines available (for DDP)

seed: int = 42#

random seed initilization

class nerfstudio.configs.base_config.PrintableConfig#

Bases: object

Printable Config defining str function

class nerfstudio.configs.base_config.TrainerConfig(steps_per_save: int = 1000, steps_per_eval_batch: int = 500, steps_per_eval_image: int = 500, steps_per_eval_all_images: int = 25000, max_num_iterations: int = 1000000, mixed_precision: bool = False, relative_model_dir: Path = PosixPath('nerfstudio_models'), save_only_latest_checkpoint: bool = True, load_dir: Optional[Path] = None, load_step: Optional[int] = None, load_config: Optional[Path] = None)#

Bases: PrintableConfig

Configuration for training regimen

load_dir: Optional[Path] = None#

Optionally specify a pre-trained model directory to load from.

load_step: Optional[int] = None#

Optionally specify model step to load from; if none, will find most recent model in load_dir.

max_num_iterations: int = 1000000#

Maximum number of iterations to run.

mixed_precision: bool = False#

Whether or not to use mixed precision for training.

relative_model_dir: Path = PosixPath('nerfstudio_models')#

Relative path to save all checkpoints.

save_only_latest_checkpoint: bool = True#

Whether to only save the latest checkpoint or all checkpoints.

steps_per_eval_all_images: int = 25000#

Number of steps between eval all images.

steps_per_eval_batch: int = 500#

Number of steps between randomly sampled batches of rays.

steps_per_eval_image: int = 500#

Number of steps between single eval images.

steps_per_save: int = 1000#

Number of steps between saves.

class nerfstudio.configs.base_config.ViewerConfig(relative_log_filename: str = 'viewer_log_filename.txt', start_train: bool = True, zmq_port: Optional[int] = None, launch_bridge_server: bool = True, websocket_port: Optional[int] = 7007, ip_address: str = '127.0.0.1', num_rays_per_chunk: int = 32768, max_num_display_images: int = 512, quit_on_train_completion: bool = False, skip_openrelay: bool = False)#

Bases: PrintableConfig

Configuration for viewer instantiation

ip_address: str = '127.0.0.1'#

the ip address where the bridge server is running

launch_bridge_server: bool = True#

whether or not to launch the bridge server

max_num_display_images: int = 512#

Maximum number of training images to display in the viewer, to avoid lag. This does not change which images are actually used in training/evaluation. If -1, display all.

num_rays_per_chunk: int = 32768#

number of rays per chunk to render with viewer

quit_on_train_completion: bool = False#

Whether to kill the training job when it has completed. Note this will stop rendering in the viewer.

relative_log_filename: str = 'viewer_log_filename.txt'#

Filename to use for the log file.

skip_openrelay: bool = False#

Avoid using openrelay to communicate with the viewer. Try disabling if you have trouble connecting to the viewer

start_train: bool = True#

whether to immediately start training upon loading viewer if False, will just visualize dataset but you can toggle training in viewer

websocket_port: Optional[int] = 7007#

the default websocket port to connect to

zmq_port: Optional[int] = None#

The zmq port to connect to for communication. If None, find an available port.