BigEarthNet#
- class torchgeo.datasets.BigEarthNet(root='data', split='train', bands='all', num_classes=19, transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetBigEarthNet dataset.
The BigEarthNet dataset is a dataset for multilabel remote sensing image scene classification.
Dataset features:
590,326 patches from 125 Sentinel-1 and Sentinel-2 tiles
Imagery from tiles in Europe between Jun 2017 - May 2018
12 spectral bands with 10-60 m per pixel resolution (base 120x120 px)
2 synthetic aperture radar bands (120x120 px)
43 or 19 scene classes from the 2018 CORINE Land Cover database (CLC 2018)
Dataset format:
images are composed of multiple single channel geotiffs
labels are multiclass, stored in a single json file per image
mapping of Sentinel-1 to Sentinel-2 patches are within Sentinel-1 json files
Sentinel-1 bands: (VV, VH)
Sentinel-2 bands: (B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12)
All bands: (VV, VH, B01, B02, B03, B04, B05, B06, B07, B08, B8A, B09, B11, B12)
Sentinel-2 bands are of different spatial resolutions and upsampled to 10m
Dataset classes (43):
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
Permanently irrigated land
Rice fields
Vineyards
Fruit trees and berry plantations
Olive groves
Pastures
Annual crops associated with permanent crops
Complex cultivation patterns
Land principally occupied by agriculture, with significant areas of natural vegetation
Agro-forestry areas
Broad-leaved forest
Coniferous forest
Mixed forest
Natural grassland
Moors and heathland
Sclerophyllous vegetation
Transitional woodland/shrub
Beaches, dunes, sands
Bare rock
Sparsely vegetated areas
Burnt areas
Inland marshes
Peatbogs
Salt marshes
Salines
Intertidal flats
Water courses
Water bodies
Coastal lagoons
Estuaries
Sea and ocean
Dataset classes (19):
Urban fabric
Industrial or commercial units
Arable land
Permanent crops
Pastures
Complex cultivation patterns
Land principally occupied by agriculture, with significant areas of natural vegetation
Agro-forestry areas
Broad-leaved forest
Coniferous forest
Mixed forest
Natural grassland and sparsely vegetated areas
Moors, heathland and sclerophyllous vegetation
Transitional woodland, shrub
Beaches, dunes, sands
Inland wetlands
Coastal wetlands
Inland waters
Marine waters
The source for the above dataset classes, their respective ordering, and 43-to-19-class mappings can be found here:
If you use this dataset in your research, please cite the following paper:
- __init__(root='data', split='train', bands='all', num_classes=19, transforms=None, download=False, checksum=False)[source]#
Initialize a new BigEarthNet dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – train/val/test split to load
bands (str) – load Sentinel-1 bands, Sentinel-2, or both. one of {s1, s2, all}
num_classes (int) – number of classes to load in target. one of {19, 43}
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, show_titles=True, suptitle=None)[source]#
Plot a sample from the dataset.
- Parameters:
- Returns:
a matplotlib Figure with the rendered sample
- Return type:
Added in version 0.2.
- __annotate_func__()#
The type of the None singleton.
- class torchgeo.datasets.BigEarthNetV2(root='data', split='train', bands='all', transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetBigEarthNetV2 dataset.
The BigEarthNet V2 dataset contains improved labels, improved geospatial data splits and additionally pixel-level labels from CORINE Land Cover (CLC) map of 2018. Additionally, some problematic patches from V1 have been removed.
If you use this dataset in your research, please cite the following paper:
Added in version 0.7.
- __init__(root='data', split='train', bands='all', transforms=None, download=False, checksum=False)[source]#
Initialize a new BigEarthNet V2 dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – train/val/test split to load
bands (str) – load Sentinel-1 bands, Sentinel-2, or both. one of {s1, s2, all}
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.
AssertionError – If split, or bands, are not valid.
- __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.