CropHarvest#
- class torchgeo.datasets.CropHarvest(root='data', transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetCropHarvest dataset.
CropHarvest is a crop classification dataset.
Dataset features:
single pixel time series with crop-type labels
18 bands per image over 12 months
Dataset format:
arrays are 12x18 with 18 bands over 12 months
Dataset properties:
is_crop - whether or not a single pixel contains cropland
classification_label - optional field identifying a specific crop type
dataset - source dataset for the imagery
lat - latitude
lon - longitude
If you use this dataset in your research, please cite the following paper:
This dataset requires the following additional library to be installed:
h5py to load the dataset
Added in version 0.6.
- all_bands: tuple[str, ...] = ('VV', 'VH', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B8A', 'B9', 'B11', 'B12', 'temperature_2m', 'total_precipitation', 'elevation', 'slope', 'NDVI')#
Names of all available bands in the dataset
- __init__(root='data', transforms=None, download=False, checksum=False)[source]#
Initialize a new CropHarvest dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
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
checksum (bool) – if True, check the MD5 of the downloaded files (may be slow)
- Raises:
DatasetNotFoundError – If dataset is not found and download is False.
DependencyNotFoundError – If h5py is not installed.
- __len__()[source]#
Return the number of data points in the dataset.
- Returns:
length of the dataset
- Return type:
- plot(sample, suptitle=None)[source]#
Plot a sample from the dataset using bands for Agriculture RGB composite.
- __annotate_func__()#
The type of the None singleton.