Skip to content

Sursentia

Tiles processor that uses the Sursentia model to predict landcover and solar panels.

Model input channels
  • ChannelName.R: Red channel, raster channel, ground sampling distance of 0.1 to 0.5 meters per pixel, standardized values with a mean of 0.392 and a standard deviation of 0.198
  • ChannelName.G: Green channel, raster channel, ground sampling distance of 0.1 to 0.5 meters per pixel, standardized values with a mean of 0.423 and a standard deviation of 0.173
  • ChannelName.B: Blue channel, raster channel, ground sampling distance of 0.1 to 0.5 meters per pixel, standardized values with a mean of 0.373 and a standard deviation of 0.157
  • Use the SursentiaPreprocessor to preprocess the input channels
Model output channels
  • 'sursentia_landcover': Landcover channel, raster channel, ground sampling distance of the input channels, the values are 0 (buildings), 1 (buildings with green roofs), 2 (impervious surfaces), 3 (non-impervious surfaces), and 4 (water bodies)
  • 'sursentia_solar': Solar panels channel, raster channel, ground sampling distance of the input channels, the values are 0 (background) and 1 (solar panels)
  • Use the SursentiaMapFieldProcessor to map the fields of the layers
Additional dependencies

Sursentia requires the sursentia dependency group and torch.

Implements the TilesProcessor protocol.

PARAMETER DESCRIPTION
r_channel_name

Channel name of the red channel

TYPE: ChannelName | str DEFAULT: ChannelName.R

g_channel_name

Channel name of the green channel

TYPE: ChannelName | str DEFAULT: ChannelName.G

b_channel_name

Channel name of the blue channel

TYPE: ChannelName | str DEFAULT: ChannelName.B

landcover_channel_name

Channel name of the landcover channel (if None, the landcover head of the model is not used)

TYPE: str | None DEFAULT: 'sursentia_landcover'

solar_channel_name

Channel name of the solar panels channel (if None, the solar head of the model is not used)

TYPE: str | None DEFAULT: 'sursentia_solar'

batch_size

Batch size of the sliding window inference

TYPE: int DEFAULT: 1

version

Version of the model (V1_0)

TYPE: SursentiaVersion DEFAULT: SursentiaVersion.V1_0

device

Device to run the model on (CPU or GPU)

TYPE: Device DEFAULT: Device.CPU

cache_dir_path

Path to cache directory of the model

TYPE: Path DEFAULT: Path('cache')

remove_channels

If True, the channels are removed

TYPE: bool DEFAULT: True

from_config classmethod

Creates the Sursentia model from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: SursentiaConfig

RETURNS DESCRIPTION
Sursentia

Sursentia

__call__

Runs the Sursentia model.

PARAMETER DESCRIPTION
tiles

Tiles

TYPE: Tiles

RETURNS DESCRIPTION
Tiles

Tiles


SursentiaConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of Sursentia

Create the configuration from a config file
  • Use '1.0' instead of SursentiaVersion.V1_0
  • Use 'cpu' or 'gpu' instead of Device.CPU or Device.GPU
  • Use null instead of None
  • Use false or true instead of False or True
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary_models'
name: 'Sursentia'
config:
  r_channel_name: 'r'
  g_channel_name: 'g'
  b_channel_name: 'b'
  landcover_channel_name: 'sursentia_landcover'
  solar_channel_name: 'sursentia_solar'
  batch_size: 1
  version: '1.0'
  device: 'cpu'
  cache_dir_path: 'cache'
  remove_channels: true
ATTRIBUTE DESCRIPTION
r_channel_name

Channel name of the red channel - defaults to ChannelName.R

TYPE: ChannelName | str

g_channel_name

Channel name of the green channel - defaults to ChannelName.G

TYPE: ChannelName | str

b_channel_name

Channel name of the blue channel - defaults to ChannelName.B

TYPE: ChannelName | str

landcover_channel_name

Channel name of the landcover channel (if None, the landcover head of the model is not used) - defaults to 'sursentia_landcover'

TYPE: str | None

solar_channel_name

Channel name of the solar panels channel (if None, the solar head of the model is not used) - defaults to 'sursentia_solar'

TYPE: str | None

batch_size

Batch size of the sliding window inference - defaults to 1

TYPE: int

version

Version of the model (V1_0) - defaults to SursentiaVersion.V1_0

TYPE: SursentiaVersion

device

Device to run the model on (CPU or GPU) - defaults to Device.CPU

TYPE: Device

cache_dir_path

Path to the cache directory of the model - defaults to 'cache'

TYPE: Path

remove_channels

If True, the channels are removed - defaults to True

TYPE: bool


SursentiaPreprocessor

Tiles processor that preprocesses the input channels of the Sursentia model.

Implements the TilesProcessor protocol.

PARAMETER DESCRIPTION
r_channel_name

Channel name of the red channel

TYPE: ChannelName | str DEFAULT: ChannelName.R

g_channel_name

Channel name of the green channel

TYPE: ChannelName | str DEFAULT: ChannelName.G

b_channel_name

Channel name of the blue channel

TYPE: ChannelName | str DEFAULT: ChannelName.B

new_r_channel_name

New channel name of the red channel

TYPE: ChannelName | str | None DEFAULT: None

new_g_channel_name

New channel name of the green channel

TYPE: ChannelName | str | None DEFAULT: None

new_b_channel_name

New channel name of the blue channel

TYPE: ChannelName | str | None DEFAULT: None

max_num_threads

Maximum number of threads

TYPE: int | None DEFAULT: None

from_config classmethod

Creates a sursentia preprocessor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: SursentiaPreprocessorConfig

RETURNS DESCRIPTION
SursentiaPreprocessor

Sursentia preprocessor

__call__

Preprocesses the input channels.

PARAMETER DESCRIPTION
tiles

Tiles

TYPE: Tiles

RETURNS DESCRIPTION
Tiles

Tiles


SursentiaPreprocessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of SursentiaPreprocessor

Create the configuration from a config file
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary_models'
name: 'SursentiaPreprocessor'
config:
  r_channel_name: 'r'
  g_channel_name: 'g'
  b_channel_name: 'b'
  new_r_channel_name: null
  new_g_channel_name: null
  new_b_channel_name: null
  max_num_threads: null
ATTRIBUTE DESCRIPTION
r_channel_name

Channel name of the red channel - defaults to ChannelName.R

TYPE: ChannelName | str

g_channel_name

Channel name of the green channel - defaults to ChannelName.G

TYPE: ChannelName | str

b_channel_name

Channel name of the blue channel - defaults to ChannelName.B

TYPE: ChannelName | str

new_r_channel_name

New channel name of the red channel - defaults to None

TYPE: ChannelName | str | None

new_g_channel_name

New channel name of the green channel - defaults to None

TYPE: ChannelName | str | None

new_b_channel_name

New channel name of the blue channel - defaults to None

TYPE: ChannelName | str | None

max_num_threads

Maximum number of threads - defaults to None

TYPE: int | None


SursentiaMapFieldProcessor

Vector processor that maps the fields of the layers of the Sursentia model.

Landcover mapping
  • 0: 'Gebäude'
  • 1: 'Gründach'
  • 2: 'versiegelte Fläche'
  • 3: 'nicht versiegelte Fläche'
  • 4: 'Gewässer'
Solar mapping
  • 0: 'Hintergrund'
  • 1: 'Solaranlage'

Implements the VectorProcessor protocol.

PARAMETER DESCRIPTION
field

Field

TYPE: str

landcover_layer_name

Layer name of the landcover layer (if None, the landcover layer is not used)

TYPE: str | None DEFAULT: 'sursentia_landcover'

solar_layer_name

Layer name of the solar layer (if None, the solar layer is not used)

TYPE: str | None DEFAULT: 'sursentia_solar'

new_landcover_layer_name

New layer name of the landcover layer

TYPE: str | None DEFAULT: None

new_solar_layer_name

New layer name of the solar layer

TYPE: str | None DEFAULT: None

from_config classmethod

Creates a sursentia map field processor from the configuration.

PARAMETER DESCRIPTION
config

Configuration

TYPE: SursentiaMapFieldProcessorConfig

RETURNS DESCRIPTION
SursentiaMapFieldProcessor

Sursentia map field processor

__call__

Maps the fields of the layers.

PARAMETER DESCRIPTION
vector

Vector

TYPE: Vector

RETURNS DESCRIPTION
Vector

Vector


SursentiaMapFieldProcessorConfig

Bases: pydantic.BaseModel

Configuration for the from_config class method of SursentiaMapFieldProcessor

Create the configuration from a config file
  • Use null instead of None
Example

You can create the configuration from a config file.

config.yaml
package: 'aviary_models'
name: 'SursentiaMapFieldProcessor'
config:
  field: 'my_field'
  landcover_layer_name: 'sursentia_landcover'
  solar_layer_name: 'sursentia_solar'
  new_landcover_layer_name: null
  new_solar_layer_name: null
ATTRIBUTE DESCRIPTION
field

Field

TYPE: str

landcover_layer_name

Layer name of the landcover layer (if None, the landcover layer is not used) - defaults to 'sursentia_landcover'

TYPE: str | None

solar_layer_name

Layer name of the solar layer (if None, the solar layer is not used) - defaults to 'sursentia_solar'

TYPE: str | None

new_landcover_layer_name

New layer name of the landcover layer - defaults to None

TYPE: str | None

new_solar_layer_name

New layer name of the solar layer - defaults to None

TYPE: str | None


Device

Bases: Enum

ATTRIBUTE DESCRIPTION
CPU

CPU device

GPU

GPU device


SursentiaVersion

Bases: Enum

ATTRIBUTE DESCRIPTION
V1_0

Version 1.0