ZueriCrop#
- class torchgeo.datasets.ZueriCrop(root='data', bands=('NIR', 'B03', 'B02', 'B04', 'B05', 'B06', 'B07', 'B11', 'B12'), transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetZueriCrop dataset.
The ZueriCrop dataset is a dataset for time-series instance segmentation of crops.
Dataset features:
Sentinel-2 multispectral imagery
instance masks of 48 crop categories
nine multispectral bands
116k images with 10 m per pixel resolution (24x24 px)
~28k time-series containing 142 images each
Dataset format:
single hdf5 dataset containing images, semantic masks, and instance masks
data is parsed into images and instance masks, boxes, and labels
one mask per time-series
Dataset classes:
48 fine-grained hierarchical crop categories
If you use this dataset in your research, please cite the following paper:
Note
This dataset requires the following additional library to be installed:
h5py to load the dataset
- __init__(root='data', bands=('NIR', 'B03', 'B02', 'B04', 'B05', 'B06', 'B07', 'B11', 'B12'), transforms=None, download=False, checksum=False)[source]#
Initialize a new ZueriCrop 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, time_step=0, show_titles=True, 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.