Skip to content

ONNXSegmentationModel

Bases: SegmentationModel

ONNX model for segmentation

Implements the Model protocol.

PARAMETER DESCRIPTION
path

path to the model

TYPE: Path

ground_sampling_distance

ground sampling distance in meters

TYPE: GroundSamplingDistance

buffer_size

buffer size in meters (specifies the area around the tile that is additionally fetched)

TYPE: BufferSize DEFAULT: 0

device

device (CPU or CUDA)

TYPE: Device DEFAULT: Device.CPU

from_huggingface classmethod

Creates a segmentation model from the Hugging Face Hub.

PARAMETER DESCRIPTION
repo

repository (Hugging Face Hub, e.g., 'user/repo')

TYPE: str

path

path to the model (Hugging Face Hub)

TYPE: str

ground_sampling_distance

ground sampling distance in meters

TYPE: GroundSamplingDistance

buffer_size

buffer size in meters (specifies the area around the tile that is additionally fetched)

TYPE: BufferSize DEFAULT: 0

device

device (CPU or CUDA)

TYPE: Device DEFAULT: Device.CPU

RETURNS DESCRIPTION
SegmentationModel

segmentation model

from_aviary classmethod

Creates a segmentation model from the name of a model in aviary.

PARAMETER DESCRIPTION
name

name of the model

TYPE: str

ground_sampling_distance

ground sampling distance in meters

TYPE: GroundSamplingDistance

buffer_size

buffer size in meters (specifies the area around the tile that is additionally fetched)

TYPE: BufferSize DEFAULT: 0

device

device (CPU or CUDA)

TYPE: Device DEFAULT: Device.CPU

RETURNS DESCRIPTION
SegmentationModel

segmentation model

from_config classmethod

Creates a segmentation model from the configuration.

PARAMETER DESCRIPTION
config

configuration

TYPE: SegmentationModelConfig

RETURNS DESCRIPTION
SegmentationModel

segmentation model

RAISES DESCRIPTION
AviaryUserError

Invalid configuration

__call__

Runs the model.

PARAMETER DESCRIPTION
inputs

batched inputs

TYPE: npt.NDArray

RETURNS DESCRIPTION
npt.NDArray

batched predictions