Rwanda Field Boundary#

class torchgeo.datasets.RwandaFieldBoundary(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04'), transforms=None, download=False)[source]#

Bases: NonGeoDataset

Rwanda Field Boundary Competition dataset.

This dataset contains field boundaries for smallholder farms in eastern Rwanda. The Nasa Harvest program funded a team of annotators from TaQadam to label Planet imagery for the 2021 growing season for the purpose of conducting the Rwanda Field boundary detection Challenge. The dataset includes rasterized labeled field boundaries and time series satellite imagery from Planet’s NICFI program. Planet’s basemap imagery is provided for six months (March, April, August, October, November and December). Note: only fields that were big enough to be differentiated on the Planetscope imagery were labeled, only fields that were fully contained within the chips were labeled. The paired dataset is provided in 256x256 chips for a total of 70 tiles covering 1532 individual fields.

The labels are provided as binary semantic segmentation labels:

  1. No field-boundary

  2. Field-boundary

If you use this dataset in your research, please cite the following:

Note

This dataset requires the following additional library to be installed:

  • azcopy: to download the dataset from Source Cooperative.

Added in version 0.5.

__init__(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04'), transforms=None, download=False)[source]#

Initialize a new RwandaFieldBoundary instance.

Parameters:
  • root (str | PathLike[str]) – root directory where dataset can be found

  • split (str) – one of “train” or “test”

  • bands (Sequence[str]) – the subset of bands to load

  • transforms (Callable[[dict[str, Any]], dict[str, Any]] | None) – a function/transform that takes input sample and its target as entry and returns a transformed version

  • download (bool) – if True, download dataset and store it in the root directory

Raises:
__len__()[source]#

Return the number of chips in the dataset.

Returns:

length of the dataset

Return type:

int

__getitem__(index)[source]#

Return an index within the dataset.

Parameters:

index (int) – index to return

Returns:

a dict containing image and mask at index.

Return type:

dict[str, Any]

plot(sample, show_titles=True, time_step=0, suptitle=None)[source]#

Plot a sample from the dataset.

Parameters:
  • sample (dict[str, Any]) – a sample returned by __getitem__()

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

  • time_step (int) – time step at which to access image, beginning with 0

  • suptitle (str | None) – optional string to use as a suptitle

Returns:

a matplotlib Figure with the rendered sample

Raises:

RGBBandsMissingError – If bands does not include all RGB bands.

Return type:

Figure

__annotate_func__()#

The type of the None singleton.