SustainBench Crop Yield#
- class torchgeo.datasets.SustainBenchCropYield(root='data', split='train', countries=['usa'], transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetSustainBench Crop Yield Dataset.
This dataset contains MODIS band histograms and soybean yield estimates for selected counties in the USA, Argentina and Brazil. The dataset is part of the SustainBench datasets for tackling the UN Sustainable Development Goals (SDGs).
Dataset Format:
.npz files of stacked samples
Dataset Features:
input histogram of 7 surface reflectance and 2 surface temperature bands from MODIS pixel values in 32 ranges across 32 timesteps resulting in 32x32x9 input images
regression target value of soybean yield in metric tonnes per harvested hectare
If you use this dataset in your research, please cite:
Added in version 0.5.
- __init__(root='data', split='train', countries=['usa'], transforms=None, download=False, checksum=False)[source]#
Initialize a new Dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (Literal['train', 'dev', 'test']) – one of “train”, “dev”, or “test”
countries (list[Literal['usa', 'brazil', 'argentina']]) – which countries to include in the dataset
transforms (Callable[[dict[str, Any]], dict[str, Any]] | None) – a function/transform that takes an input sample and returns a transformed version
download (bool) – if True, download dataset and store it in the root directory
checksum (bool) – if True, check the MD5 after downloading files (may be slow)
- Raises:
AssertionError – if
countriescontains invalid countries or ifsplitis invalidDatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of data points in the dataset.
- Returns:
length of the dataset
- Return type: