mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-21 15:15:43 +08:00
ns-render - render all images (#2459)
* ns-render - render all images * Fix commonprefix->commonpath * Fix raw rendering
This commit is contained in:
1 parent
7856aa0060
commit
b78d0faa12
2 files changed
+211
-4
No files matched your search
@@ -20,7 +20,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from typing import Literal, Optional, Tuple
|
||||
from typing import Literal, Optional, Tuple, Callable
|
||||
|
||||
import torch
|
||||
import yaml
|
||||
@@ -69,6 +69,7 @@ def eval_setup(
|
||||
config_path: Path,
|
||||
eval_num_rays_per_chunk: Optional[int] = None,
|
||||
test_mode: Literal["test", "val", "inference"] = "test",
|
||||
update_config_callback: Optional[Callable[[TrainerConfig], TrainerConfig]] = None,
|
||||
) -> Tuple[TrainerConfig, Pipeline, Path, int]:
|
||||
"""Shared setup for loading a saved pipeline for evaluation.
|
||||
|
||||
@@ -79,6 +80,7 @@ def eval_setup(
|
||||
'val': loads train/val datasets into memory
|
||||
'test': loads train/test dataset into memory
|
||||
'inference': does not load any dataset into memory
|
||||
update_config_callback: Callback to update the config before loading the pipeline
|
||||
|
||||
|
||||
Returns:
|
||||
@@ -92,6 +94,9 @@ def eval_setup(
|
||||
if eval_num_rays_per_chunk:
|
||||
config.pipeline.model.eval_num_rays_per_chunk = eval_num_rays_per_chunk
|
||||
|
||||
if update_config_callback is not None:
|
||||
config = update_config_callback(config)
|
||||
|
||||
# load checkpoints from wherever they were saved
|
||||
# TODO: expose the ability to choose an arbitrary checkpoint
|
||||
config.load_dir = config.get_checkpoint_dir()
|
||||
|
||||
Reference in new issue
Block a user