EuroSAT#
- class torchgeo.datasets.EuroSAT(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B09', 'B10', 'B11', 'B12', 'B8A'), transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoClassificationDatasetEuroSAT dataset.
The EuroSAT dataset is based on Sentinel-2 satellite images covering 13 spectral bands and consists of 10 target classes with a total of 27,000 labeled and geo-referenced images.
Dataset format:
rasters are 13-channel GeoTiffs
labels are values in the range [0,9]
Dataset classes:
Annual Crop
Forest
Herbaceous Vegetation
Highway
Industrial Buildings
Pasture
Permanent Crop
Residential Buildings
River
Sea & Lake
This dataset uses the train/val/test splits defined in the “In-domain representation learning for remote sensing” paper:
If you use this dataset in your research, please cite the following papers:
- __init__(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B09', 'B10', 'B11', 'B12', 'B8A'), transforms=None, download=False, checksum=False)[source]#
Initialize a new EuroSAT dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – one of “train”, “val”, or “test”
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:
AssertionError – if
splitargument is invalidDatasetNotFoundError – If dataset is not found and download is False.
Added in version 0.3: The bands parameter.
- plot(sample, 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.
- __annotate_func__()#
The type of the None singleton.
- class torchgeo.datasets.EuroSATSpatial(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B09', 'B10', 'B11', 'B12', 'B8A'), transforms=None, download=False, checksum=False)[source]#
Bases:
EuroSATOverrides the default EuroSAT dataset splits.
Splits the data into training, validation, and test sets based on longitude. The splits are distributed as 60%, 20%, and 20% respectively.
Added in version 0.6.
- __annotate_func__()#
The type of the None singleton.
- class torchgeo.datasets.EuroSAT100(root='data', split='train', bands=('B01', 'B02', 'B03', 'B04', 'B05', 'B06', 'B07', 'B08', 'B09', 'B10', 'B11', 'B12', 'B8A'), transforms=None, download=False, checksum=False)[source]#
Bases:
EuroSATSubset of EuroSAT containing only 100 images.
Intended for tutorials and demonstrations, not for benchmarking.
Maintains the same file structure, classes, and train-val-test split. Each class has 10 images (6 train, 2 val, 2 test), for a total of 100 images.
Added in version 0.5.
- __annotate_func__()#
The type of the None singleton.