SeasoNet#
- class torchgeo.datasets.SeasoNet(root='data', split='train', seasons=frozenset({'Fall', 'Snow', 'Spring', 'Summer', 'Winter'}), bands=('10m_RGB', '10m_IR', '20m', '60m'), grids=[1, 2], concat_seasons=1, transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetSeasoNet Semantic Segmentation dataset.
The SeasoNet dataset consists of 1,759,830 multi-spectral Sentinel-2 image patches, taken from 519,547 unique locations, covering the whole surface area of Germany. Annotations are provided in the form of pixel-level land cover and land usage segmentation masks from the German land cover model LBM-DE2018 with land cover classes based on the CORINE Land Cover database (CLC) 2018. The set is split into two overlapping grids, consisting of roughly 880,000 samples each, which are shifted by half the patch size in both dimensions. The images in each of the both grids themselves do not overlap.
Dataset format:
images are 16-bit GeoTiffs, split into separate files based on resolution
images include 12 spectral bands with 10, 20 and 60 m per pixel resolutions
masks are single-channel 8-bit GeoTiffs
Dataset classes:
Continuous urban fabric
Discontinuous urban fabric
Industrial or commercial units
Road and rail networks and associated land
Port areas
Airports
Mineral extraction sites
Dump sites
Construction sites
Green urban areas
Sport and leisure facilities
Non-irrigated arable land
Vineyards
Fruit trees and berry plantations
Pastures
Broad-leaved forest
Coniferous forest
Mixed forest
Natural grasslands
Moors and heathland
Transitional woodland/shrub
Beaches, dunes, sands
Bare rock
Sparsely vegetated areas
Inland marshes
Peat bogs
Salt marshes
Intertidal flats
Water courses
Water bodies
Coastal lagoons
Estuaries
Sea and ocean
If you use this dataset in your research, please cite the following paper:
Added in version 0.5.
- all_bands: tuple[str, ...] = ('10m_RGB', '10m_IR', '20m', '60m')#
Names of all available bands in the dataset
- __init__(root='data', split='train', seasons=frozenset({'Fall', 'Snow', 'Spring', 'Summer', 'Winter'}), bands=('10m_RGB', '10m_IR', '20m', '60m'), grids=[1, 2], concat_seasons=1, transforms=None, download=False, checksum=False)[source]#
Initialize a new SeasoNet dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (Literal['train', 'val', 'test']) – one of “train”, “val” or “test”
seasons (Collection[str]) – list of seasons to load
grids (Iterable[int]) – which of the overlapping grids to load
concat_seasons (int) – number of seasonal images to return per sample. if 1, each seasonal image is returned as its own sample, otherwise seasonal images are randomly picked from the seasons specified in
seasonsand returned as stacked tensorstransforms (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:
- __annotate_func__()#
The type of the None singleton.
- plot(sample, show_titles=True, show_legend=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: