faninsar.samplers.RowSampler#

class faninsar.samplers.RowSampler(dataset: GeoDataset, roi: BoundingBox | None = None, row_num: int | None = None, height: int | None = None, verbose: bool = True)[source]#

Bases: PatchSampler

A sampler samples data from a dataset in a row-wise manner.

__init__(dataset: GeoDataset, roi: BoundingBox | None = None, row_num: int | None = None, height: int | None = None, verbose: bool = True) None[source]#

Initialize a RowSampler.

Parameters:
  • dataset (GeoDataset) – The dataset needs to be sampled.

  • roi (BoundingBox or Sequence, optional) – The the region of interest bounding box. If not provided, the bounding box of the dataset will be used.

  • row_num (int, optional) – The number of patches to be sampled for row-wise sampling. If height is provided, this parameter will be ignored.

  • height (int, optional) – The height (in pixels) of the patch to be sampled for row-wise sampling . if not provided, the row_num will be used.

  • verbose (bool, optional) – Whether to print verbose information. The verbose of the dataset will be set to this value. Default is True.

Methods

__init__(dataset[, roi, row_num, height, ...])

Initialize a RowSampler.

Attributes

boxes

The bounding boxes/patches of the sampler used to sample dataset.

shape

The shape of the patch sampler.

property boxes: ndarray#

The bounding boxes/patches of the sampler used to sample dataset.

property shape: tuple[int]#

The shape of the patch sampler.