Remove dataparser dependency (#1529)

This commit is contained in:
Matthew Tancik authored and GitHub committed 2023-02-27 18:32:40 -08:00
1 parent 4a9764d3c4
commit bfaf11cd72
6 files changed
+103 -49

No files matched your search

+5 -5
View File
@@ -58,11 +58,11 @@ class RunViewer:
self._start_viewer(config, pipeline)
def _start_viewer(self, config: TrainerConfig, pipeline):
def _start_viewer(self, config: TrainerConfig, pipeline: Pipeline):
base_dir = config.get_base_dir()
viewer_log_path = base_dir / config.viewer.relative_log_filename
viewer_state, banner_messages = viewer_utils.setup_viewer(
config.viewer, log_filename=viewer_log_path, datapath=config.pipeline.datamanager.dataparser.data
config.viewer, log_filename=viewer_log_path, datapath=pipeline.datamanager.get_datapath()
)
# We don't need logging, but writer.GLOBAL_BUFFER needs to be populated
@@ -76,16 +76,16 @@ class RunViewer:
)
while True:
viewer_state.vis["renderingState/isTraining"].write(False)
self._update_viewer_state(viewer_state, config, pipeline)
self._update_viewer_state(viewer_state, pipeline)
def _update_viewer_state(self, viewer_state: viewer_utils.ViewerState, config: TrainerConfig, pipeline: Pipeline):
def _update_viewer_state(self, viewer_state: viewer_utils.ViewerState, pipeline: Pipeline):
"""Updates the viewer state by rendering out scene with current pipeline
Returns the time taken to render scene.
"""
# NOTE: step must be > 0 otherwise the rendering would not happen
step = 1
num_rays_per_batch = config.pipeline.datamanager.train_num_rays_per_batch
num_rays_per_batch = pipeline.datamanager.get_train_rays_per_batch()
with TimeWriter(writer, EventName.ITER_VIS_TIME) as _:
try:
viewer_state.update_scene(self, step, pipeline.model, num_rays_per_batch)