def save(self, labels): """Save labels to URI.""" boxes = labels.get_boxes() class_ids = labels.get_class_ids().tolist() scores = labels.get_scores().tolist() geojson = boxes_to_geojson(boxes, class_ids, self.crs_transformer, self.class_config, scores=scores) json_to_file(geojson, self.uri)
def save(self, labels): """Save labels to URI if writable. Note that if the grid is inferred from polygons, only the grid will be written, not the original polygons. """ boxes = labels.get_cells() class_ids = labels.get_class_ids() scores = list(labels.get_scores()) geojson = boxes_to_geojson(boxes, class_ids, self.crs_transformer, self.class_config, scores=scores) json_to_file(geojson, self.uri)