Benin Cashew Plantations#
- class torchgeo.datasets.BeninSmallHolderCashews(root='data', chip_size=256, stride=128, bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B8A', 'B09', 'B11', 'B12', 'CLD'), transforms=None, download=False)[source]#
Bases:
NonGeoDatasetSmallholder Cashew Plantations in Benin dataset.
This dataset contains labels for cashew plantations in a 120 km2 area in the center of Benin. Each pixel is classified for Well-managed plantation, Poorly-managed plantation, No plantation and other classes. The labels are generated using a combination of ground data collection with a handheld GPS device, and final corrections based on Airbus Pléiades imagery. See this website for dataset details.
Specifically, the data consists of Sentinel 2 imagery from a 120 km2 area in the center of Benin over 71 points in time from 11/05/2019 to 10/30/2020 and polygon labels for 6 classes:
No data
Well-managed plantation
Poorly-managed planatation
Non-plantation
Residential
Background
Uncertain
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.
- __init__(root='data', chip_size=256, stride=128, bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B8A', 'B09', 'B11', 'B12', 'CLD'), transforms=None, download=False)[source]#
Initialize a new Benin Smallholder Cashew Plantations Dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
chip_size (int) – size of chips
stride (int) – spacing between chips, if less than chip_size, then there will be overlap between chips
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:
AssertionError – If bands is invalid.
DatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of chips in the dataset.
- Returns:
length of the dataset
- Return type:
- plot(sample, show_titles=True, time_step=0, suptitle=None)[source]#
Plot a sample from the dataset.
- Parameters:
- Returns:
a matplotlib Figure with the rendered sample
- Raises:
RGBBandsMissingError – If bands does not include all RGB bands.
- Return type:
Added in version 0.2.