Exemplo n.º 1
0
 def save_clusters_geojson(self, geojson):
     filepath = self._clusters_geojson_path()
     with io.open_wt(filepath) as fout:
         io.json_dump(geojson, fout)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def save_reference_lla(self, reference):
     with io.open_wt(self._reference_lla_path()) as fout:
         io.json_dump(reference, fout)
Exemplo n.º 4
0
 def save_navigation_graph(self, navigation_graphs):
     with io.open_wt(self._navigation_graph_file()) as fout:
         io.json_dump(navigation_graphs, fout)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
 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)
Exemplo n.º 7
0
 def save_navigation_graph(self, navigation_graphs):
     with open(self.__navigation_graph_file(), 'w') as fout:
         io.json_dump(navigation_graphs, fout)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
 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)
Exemplo n.º 10
0
 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)
Exemplo n.º 11
0
 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)
Exemplo n.º 12
0
 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)
Exemplo n.º 13
0
 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)
Exemplo n.º 14
0
 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)
Exemplo n.º 15
0
 def save_clusters_geojson(self, geojson):
     filepath = self._clusters_geojson_path()
     with io.open_wt(filepath) as fout:
         io.json_dump(geojson, fout)
Exemplo n.º 16
0
 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)
Exemplo n.º 17
0
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)
Exemplo n.º 18
0
 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)
Exemplo n.º 19
0
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)
Exemplo n.º 20
0
 def save_navigation_graph(self, navigation_graphs):
     with open(self.__navigation_graph_file(), 'w') as fout:
         io.json_dump(navigation_graphs, fout)
Exemplo n.º 21
0
def save_reference_lla(file_path, reference):
        with io.open_wt(_reference_lla_path(file_path)) as fout:
            io.json_dump(reference, fout)
Exemplo n.º 22
0
 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)
Exemplo n.º 23
0
 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)
Exemplo n.º 24
0
 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)
Exemplo n.º 25
0
 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)
Exemplo n.º 26
0
 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)
Exemplo n.º 27
0
 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)
Exemplo n.º 28
0
 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)
Exemplo n.º 29
0
 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)
Exemplo n.º 30
0
 def save_reference_lla(self, reference):
     with io.open_wt(self._reference_lla_path()) as fout:
         io.json_dump(reference, fout)
Exemplo n.º 31
0
 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)
Exemplo n.º 32
0
 def save_navigation_graph(self, navigation_graphs):
     with io.open_wt(self._navigation_graph_file()) as fout:
         io.json_dump(navigation_graphs, fout)
Exemplo n.º 33
0
 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)