dfc

Implementation for the DFC2020 competition dataset using Sentinel 1&2 data and IGBP labels in torchgeo.

class DFC2020(root: str, split='val', use_s2hr=False, use_s2mr=False, use_s2lr=False, use_s1=False, labels=False, transforms: Callable[[...], Any] | None = None)

PyTorch dataset class for the DFC2020 dataset

plot(sample: dict[str, Tensor], show_titles: bool = True, suptitle: str | None = None, classes: dict[int, str] | None = None, colours: dict[int, str] | None = None) Figure

Plot a sample from the dataset.

Adapted from torchgeo.datasets.DFC2022.plot() for DFC2020.

Parameters:
  • sample (dict[str, Tensor]) – A sample returned by __getitem__().

  • show_titles (bool) – Flag indicating whether to show titles above each panel.

  • suptitle (str) – Optional; String to use as a suptitle.

  • classes (dict[int, str]) – Optional; Dictionary mapping class labels to class names. Default: self.classes.

  • colours (dict[int, str]) – Optional; Dictionary mapping class labels to colours. Default: self.colours.

Added in version 0.28.

Returns:

A matplotlib Figure with the rendered sample.

Return type:

Figure

class SEN12MS(root: str, split='train', use_s2hr=False, use_s2mr=False, use_s2lr=False, use_s1=False, labels=False, transforms: Callable[[...], Any] | None = None)

PyTorch dataset class for the SEN12MS dataset

Expects dataset dir as: >>> - SEN12MS_holdOutScenes.txt >>> - ROIsxxxx_y >>> - lc_n >>> - s1_n >>> - s2_n

SEN12SEN12MS_holdOutScenes.txt contains the subdirs for the official train/val split and can be obtained from: https://github.com/MSchmitt1984/SEN12MS/blob/master/splits