adding check if camera_path_dir exists (#1319)

Co-authored-by: Matthew Tancik <tancik@berkeley.edu>
This commit is contained in:
Terrance WangandMatthew Tancik authored and GitHub committed 2023-01-31 14:02:57 -08:00
1 parent e73692e599
commit f3b3a517e8
1 file changed
+8 -7
+8 -7
View File
@@ -401,13 +401,14 @@ class ViewerState:
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()
if os.path.exists(camera_path_dir):
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."""