+
}
+ onClick={open_load_path_modal}
>
Load Path
-
diff --git a/nerfstudio/viewer/app/src/reducer.js b/nerfstudio/viewer/app/src/reducer.js
index 0ee2dd2ed..6de1ea7c2 100644
--- a/nerfstudio/viewer/app/src/reducer.js
+++ b/nerfstudio/viewer/app/src/reducer.js
@@ -12,6 +12,7 @@ const initialState = {
},
// for sending actual commands to the client
camera_path_payload: null,
+ populate_paths_payload: false,
// the rendering state
renderingState: {
// cameras
@@ -25,7 +26,10 @@ const initialState = {
camera_type: 'perspective',
data_base_dir: 'data_base_dir', // the base directory of the images for saving camera path with the data
- export_path: 'export_path',
+ export_path: 'export_path', // export name for render and camera_path
+
+ all_camera_paths: null, // object containing camera paths and names
+
isTraining: true,
output_options: ['rgb'], // populated by the possible Graph outputs
diff --git a/nerfstudio/viewer/app/src/themes/theme.ts b/nerfstudio/viewer/app/src/themes/theme.ts
index 4a973209e..b789c3899 100644
--- a/nerfstudio/viewer/app/src/themes/theme.ts
+++ b/nerfstudio/viewer/app/src/themes/theme.ts
@@ -169,5 +169,12 @@ export const appTheme = createTheme({
},
},
},
+ MuiSelect: {
+ styleOverrides: {
+ icon: {
+ color: '#eeeeee',
+ },
+ },
+ },
},
});
diff --git a/nerfstudio/viewer/server/viewer_utils.py b/nerfstudio/viewer/server/viewer_utils.py
index 2ac82273d..f62cf9d8f 100644
--- a/nerfstudio/viewer/server/viewer_utils.py
+++ b/nerfstudio/viewer/server/viewer_utils.py
@@ -388,6 +388,21 @@ class ViewerState:
write_to_json(Path(os.path.join(camera_paths_directory, camera_path_filename)), camera_path)
self.vis["camera_path_payload"].delete()
+ def _check_populate_paths_payload(self, trainer, step: int):
+ populate_paths_payload = self.vis["populate_paths_payload"].read()
+ if populate_paths_payload:
+ # save a model checkpoint
+ trainer.save_checkpoint(step)
+ # get all camera paths
+ camera_path_dir = os.path.join(self.datapath, "camera_paths")
+ camera_path_files = os.listdir(camera_path_dir)
+ all_path_dict = {}
+ for i in camera_path_files:
+ if i[-4:] == "json":
+ all_path_dict[i[:-5]] = load_from_json(Path(os.path.join(camera_path_dir, i)))
+ self.vis["renderingState/all_camera_paths"].write(all_path_dict)
+ self.vis["populate_paths_payload"].delete()
+
def _check_webrtc_offer(self):
"""Check if there is a webrtc offer to respond to."""
data = self.vis["webrtc/offer"].read()
@@ -463,7 +478,6 @@ class ViewerState:
step: iteration step of training
graph: the current checkpoint of the model
"""
-
has_temporal_distortion = getattr(graph, "temporal_distortion", None) is not None
self.vis["model/has_temporal_distortion"].write(str(has_temporal_distortion).lower())
@@ -471,6 +485,7 @@ class ViewerState:
self.step = step
self._check_camera_path_payload(trainer, step)
+ self._check_populate_paths_payload(trainer, step)
self._check_webrtc_offer()
camera_object = self._get_camera_object()
@@ -515,6 +530,7 @@ class ViewerState:
self._render_image_in_viewer(camera_object, graph, is_training)
camera_object = self._get_camera_object()
is_training = self.vis["renderingState/isTraining"].read()
+ self._check_populate_paths_payload(trainer, step)
self._check_camera_path_payload(trainer, step)
self._check_webrtc_offer()
run_loop = not is_training