SegmentationExporter
Bases: FromConfigMixin
Exporter for segmentation predictions
Implements the Exporter
protocol.
The predictions (i.e. raster data) are transformed to geospatial data (i.e. vector data).
The resulting geodataframe contains the geometry of the polygons and their class that is stored
in the field field_name
as the pixel value of the prediction.
The segmentation exporter creates a geopackage named output.gpkg
and exports the geodataframe
of each tile dynamically.
The coordinates of the bottom left corner of the processed tiles are exported dynamically to a JSON file
named processed_coordinates.json
.
Notes
- The segmentation exporter uses multiple threads to vectorize and export the predictions
PARAMETER | DESCRIPTION |
---|---|
path
|
path to the output directory
TYPE:
|
tile_size
|
tile size in meters
TYPE:
|
ground_sampling_distance
|
ground sampling distance in meters
TYPE:
|
epsg_code
|
EPSG code
TYPE:
|
field_name
|
name of the field in the geodataframe
TYPE:
|
num_workers
|
number of workers
TYPE:
|
from_config
classmethod
Creates a segmentation exporter from the configuration.
PARAMETER | DESCRIPTION |
---|---|
config
|
configuration
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
SegmentationExporter
|
segmentation exporter |
__call__
Exports the predictions.
PARAMETER | DESCRIPTION |
---|---|
preds
|
batched predictions
TYPE:
|
coordinates
|
coordinates (x_min, y_min) of each tile
TYPE:
|
SegmentationExporterConfig
Bases: pydantic.BaseModel
Configuration for the from_config
class method of SegmentationExporter
ATTRIBUTE | DESCRIPTION |
---|---|
path |
path to the output directory
TYPE:
|
tile_size |
tile size in meters
TYPE:
|
ground_sampling_distance |
ground sampling distance in meters
TYPE:
|
epsg_code |
EPSG code
TYPE:
|
field_name |
name of the field in the geodataframe
TYPE:
|
num_workers |
number of workers
TYPE:
|