HySpecNet-11k#
- class torchgeo.datasets.HySpecNet11k(root='data', split='train', strategy='easy', bands=None, transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetHySpecNet-11k dataset.
HySpecNet-11k is a large-scale benchmark dataset for hyperspectral image compression and self-supervised learning. It is made up of 11,483 nonoverlapping image patches acquired by the EnMAP satellite. Each patch is a portion of 128 x 128 pixels with 224 spectral bands and with a ground sample distance of 30 m.
To construct HySpecNet-11k, a total of 250 EnMAP tiles acquired during the routine operation phase between 2 November 2022 and 9 November 2022 were considered. The considered tiles are associated with less than 10% cloud and snow cover. The tiles were radiometrically, geometrically and atmospherically corrected (L2A water & land product). Then, the tiles were divided into nonoverlapping image patches. The cropped patches at the borders of the tiles were eliminated. As a result, more than 45 patches per tile are obtained, resulting in 11,483 patches for the full dataset.
We provide predefined splits obtained by randomly dividing HySpecNet into:
a training set that includes 70% of the patches,
a validation set that includes 20% of the patches, and
a test set that includes 10% of the patches.
Depending on the way that we used for splitting the dataset, we define two different splits:
an easy split, where patches from the same tile can be present in different sets (patchwise splitting); and
a hard split, where all patches from one tile belong to the same set (tilewise splitting).
If you use this dataset in your research, please cite the following paper:
Added in version 0.7.
- __init__(root='data', split='train', strategy='easy', bands=None, transforms=None, download=False, checksum=False)[source]#
Initialize a new HySpecNet11k instance.
- Parameters:
root (str | PathLike[str]) – Root directory where dataset can be found.
split (str) – One of ‘train’, ‘val’, or ‘test’.
strategy (str) – Either ‘easy’ for patchwise splitting or ‘hard’ for tilewise splitting.
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.
- __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.
- Parameters:
sample (dict[str, Any]) – A sample returned by
__getitem__().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:
- __annotate_func__()#
The type of the None singleton.