RegressionSlidingWindowGeoDataset#

class RegressionSlidingWindowGeoDataset[source]#

Bases: SlidingWindowGeoDataset

__init__(*args, **kwargs)[source]#

Constructor.

Parameters
  • scene (Scene) – A Scene object.

  • size (Union[PosInt, Tuple[PosInt, PosInt]]) – Window size.

  • stride (Union[PosInt, Tuple[PosInt, PosInt]]) – Step size between windows.

  • padding (Optional[Union[NonNegInt, Tuple[NonNegInt, NonNegInt]]]) – How many pixels the windows are allowed to overflow the sides of the raster source. If None, padding is set to size // 2. Defaults to None.

  • pad_direction (Literal['both', 'start', 'end']) – If ‘end’, only pad ymax and xmax (bottom and right). If ‘start’, only pad ymin and xmin (top and left). If ‘both’, pad all sides. Has no effect if paddiong is zero. Defaults to ‘end’.

  • transform (Optional[A.BasicTransform], optional) – Albumentations transform to apply to the windows. Defaults to None. Each transform in Albumentations takes images of type uint8, and sometimes other data types. The data type requirements can be seen at https://albumentations.ai/docs/api_reference/augmentations/transforms/ # noqa If there is a mismatch between the data type of imagery and the transform requirements, a RasterTransformer should be set on the RasterSource that converts to uint8, such as MinMaxTransformer or StatsTransformer.

  • transform_type (Optional[TransformType], optional) – Type of transform. Defaults to None.

  • normalize (bool, optional) – If True, x is normalized to [0, 1] based on its data type. Defaults to True.

  • to_pytorch (bool, optional) – If True, x and y are converted to pytorch tensors. Defaults to True.

  • return_window (bool, optional) – Make __getitem__ return the window coordinates used to generate the image. Defaults to False.

Methods

__init__(*args, **kwargs)

Constructor.

from_uris(*args, **kwargs)

init_windows()

Pre-compute windows.

__contains__(key: str) bool#
Parameters

key (str) –

Return type

bool

__getitem__(idx: int)#
Parameters

idx (int) –

__init__(*args, **kwargs)[source]#

Constructor.

Parameters
  • scene (Scene) – A Scene object.

  • size (Union[PosInt, Tuple[PosInt, PosInt]]) – Window size.

  • stride (Union[PosInt, Tuple[PosInt, PosInt]]) – Step size between windows.

  • padding (Optional[Union[NonNegInt, Tuple[NonNegInt, NonNegInt]]]) – How many pixels the windows are allowed to overflow the sides of the raster source. If None, padding is set to size // 2. Defaults to None.

  • pad_direction (Literal['both', 'start', 'end']) – If ‘end’, only pad ymax and xmax (bottom and right). If ‘start’, only pad ymin and xmin (top and left). If ‘both’, pad all sides. Has no effect if paddiong is zero. Defaults to ‘end’.

  • transform (Optional[A.BasicTransform], optional) – Albumentations transform to apply to the windows. Defaults to None. Each transform in Albumentations takes images of type uint8, and sometimes other data types. The data type requirements can be seen at https://albumentations.ai/docs/api_reference/augmentations/transforms/ # noqa If there is a mismatch between the data type of imagery and the transform requirements, a RasterTransformer should be set on the RasterSource that converts to uint8, such as MinMaxTransformer or StatsTransformer.

  • transform_type (Optional[TransformType], optional) – Type of transform. Defaults to None.

  • normalize (bool, optional) – If True, x is normalized to [0, 1] based on its data type. Defaults to True.

  • to_pytorch (bool, optional) – If True, x and y are converted to pytorch tensors. Defaults to True.

  • return_window (bool, optional) – Make __getitem__ return the window coordinates used to generate the image. Defaults to False.

static __new__(cls, *args: Any, **kwargs: Any) Any#
Parameters
  • args (Any) –

  • kwargs (Any) –

Return type

Any

classmethod from_uris(*args, **kwargs) GeoDataset#
Return type

GeoDataset

init_windows() None#

Pre-compute windows.

Return type

None