make_ss_scene#

make_ss_scene(image_uri: str | list[str], label_raster_uri: str | list[str] | None = None, class_config: ClassConfig | None = None, label_vector_uri: str | None = None, aoi_uri: str | list[str] = [], label_vector_default_class_id: int | None = None, image_raster_source_kw: dict = {}, label_raster_source_kw: dict = {}, label_vector_source_kw: dict = {}, scene_id: str | None = None) Scene[source]#

Create a semantic segmentation scene from image and label URIs.

This is a convenience method. For more fine-grained control, it is recommended to use the default constructor.

Parameters:
  • image_uri (str | list[str]) – URI or list of URIs of GeoTIFFs to use as the source of image data.

  • label_raster_uri (str | list[str] | None) – URI or list of URIs of GeoTIFFs to use as the source of segmentation label data. If the labels are in the form of GeoJSONs, use label_vector_uri instead. Defaults to None.

  • label_vector_uri (str | None) – URI of GeoJSON file to use as the source of segmentation label data. If the labels are in the form of GeoTIFFs, use label_raster_uri instead. Defaults to None.

  • class_config (ClassConfig | None) – The ClassConfig. Can be None if not using any labels.

  • aoi_uri (str | list[str]) – URI or list of URIs of GeoJSONs that specify the area-of-interest. If provided, the dataset will only access data from this area. Defaults to [].

  • label_vector_default_class_id (int | None) – If using label_vector_uri and all polygons in that file belong to the same class and they do not contain a class_id property, then use this argument to map all of the polygons to the appropriate class ID. See docs for ClassInferenceTransformer for more details. Defaults to None.

  • image_raster_source_kw (dict) – Additional arguments to pass to the RasterioSource used for image data. See docs for RasterioSource for more details. Defaults to {}.

  • label_raster_source_kw (dict) – Additional arguments to pass to the RasterioSource used for label data, if label_raster_uri is used. See docs for RasterioSource for more details. Defaults to {}.

  • label_vector_source_kw (dict) – Additional arguments to pass to the GeoJSONVectorSource used for label data, if label_vector_uri is used. See docs for GeoJSONVectorSource for more details. Defaults to {}.

  • scene_id (str | None) – Optional scene ID. If None, will be randomly generated. Defaults to None.

Raises:

ValueError – If both label_raster_uri and label_vector_uri are specified.

Returns:

A semantic segmentation scene.

Return type:

Scene