def save_clusters_geojson(self, geojson): filepath = self._clusters_geojson_path() with io.open_wt(filepath) as fout: io.json_dump(geojson, fout)
def save_reconstruction(self, reconstruction, filename=None, minify=False): with io.open_wt(self._reconstruction_file(filename)) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify)
def save_reference_lla(self, reference): with io.open_wt(self._reference_lla_path()) as fout: io.json_dump(reference, fout)
def save_navigation_graph(self, navigation_graphs): with io.open_wt(self._navigation_graph_file()) as fout: io.json_dump(navigation_graphs, fout)
def save_camera_models(self, camera_models): """Save camera models data""" with open(self.__camera_models_file(), 'w') as fout: obj = io.cameras_to_json(camera_models) io.json_dump(obj, fout)
def save_exif(self, image, data): io.mkdir_p(self._exif_path()) with io.open_wt(self._exif_file(image)) as fout: io.json_dump(data, fout)
def save_navigation_graph(self, navigation_graphs): with open(self.__navigation_graph_file(), 'w') as fout: io.json_dump(navigation_graphs, fout)
def save_rig_assignments(self, rig_assignments: List[List[Tuple[str, str]]]): """Save rig assignments data""" with self.io_handler.open_wt(self._rig_assignments_file()) as fout: io.json_dump(rig_assignments, fout)
def save_reconstruction(self, reconstruction, filename=None, indent=4): with open(self.__reconstruction_file(filename), 'w') as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout)
def save_exif(self, image, data): io.mkdir_p(self.__exif_path()) with open(self.__exif_file(image), 'w') as fout: io.json_dump(data, fout)
def save_tag_detection(self, images_with_tag_detections, filename=None): with open(self.__tag_detection_file(filename), 'w') as fout: io.json_dump(io.images_with_tag_detections_to_json(images_with_tag_detections), fout)
def save_rig_assignments(self, rig_assignments): """Save rig assignments data""" with io.open_wt(self._rig_assignments_file()) as fout: io.json_dump(rig_assignments, fout)
def save_camera_models_overrides(self, camera_models): """Save camera models overrides data""" with io.open_wt(self._camera_models_overrides_file()) as fout: obj = io.cameras_to_json(camera_models) io.json_dump(obj, fout)
def save_rig_models(self, rig_models): """Save rig models data""" with io.open_wt(self._rig_models_file()) as fout: io.json_dump(rig_models, fout)
def save_exif(file_path, image, data): io.mkdir_p(file_path) print(file_path) with io.open_wt(_exif_file(file_path, image)) as fout: print('dump') io.json_dump(data, fout)
def save_exif(self, image, data): io.mkdir_p(self.__exif_path()) with open(self.__exif_file(image), 'wb') as fout: io.json_dump(data, fout)
def save_camera_models(file_path, camera_models): """Save camera models data""" with io.open_wt(_camera_models_file(file_path)) as fout: obj = io.cameras_to_json(camera_models) io.json_dump(obj, fout)
def save_reference_lla(file_path, reference): with io.open_wt(_reference_lla_path(file_path)) as fout: io.json_dump(reference, fout)
def save_undistorted_shot_ids(self, ushot_dict: Dict[str, List[str]]): filename = os.path.join(self.data_path, "undistorted_shot_ids.json") self.io_handler.mkdir_p(self.data_path) with self.io_handler.open_wt(filename) as fout: io.json_dump(ushot_dict, fout, minify=False)
def save_exif(self, image: str, data: Dict[str, Any]) -> None: self.io_handler.mkdir_p(self._exif_path()) with self.io_handler.open_wt(self._exif_file(image)) as fout: io.json_dump(data, fout)
def save_undistorted_reconstruction(self, reconstruction): filename = os.path.join(self.data_path, "reconstruction.json") io.mkdir_p(self.data_path) with io.open_wt(filename) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify=True)
def save_reference_lla(self, reference: Dict[str, float]) -> None: with self.io_handler.open_wt(self._reference_lla_path()) as fout: io.json_dump(reference, fout)
def save_camera_models(self, camera_models: Dict[str, pygeometry.Camera]) -> None: """Save camera models data""" with self.io_handler.open_wt(self._camera_models_file()) as fout: obj = io.cameras_to_json(camera_models) io.json_dump(obj, fout)
def save_rig_cameras(self, rig_cameras: Dict[str, pymap.RigCamera]) -> None: """Save rig models data""" with self.io_handler.open_wt(self._rig_cameras_file()) as fout: io.json_dump(io.rig_cameras_to_json(rig_cameras), fout)
def save_undistorted_shot_ids(self, ushot_dict): filename = os.path.join(self.data_path, "undistorted_shot_ids.json") io.mkdir_p(self.data_path) with io.open_wt(filename) as fout: io.json_dump(ushot_dict, fout, minify=False)