SatlasPretrain#
- class torchgeo.datasets.SatlasPretrain(root='data', split='train_lowres', good_images='good_images_lowres_all', image_times='image_times', images=('sentinel1', 'sentinel2', 'landsat'), labels=('land_cover',), transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetSatlasPretrain dataset.
SatlasPretrain is a large-scale pre-training dataset for tasks that involve understanding satellite images. Regularly-updated satellite data is publicly available for much of the Earth through sources such as Sentinel-2 and NAIP, and can inform numerous applications from tackling illegal deforestation to monitoring marine infrastructure. However, developing automatic computer vision systems to parse these images requires a huge amount of manual labeling of training data. By combining over 30 TB of satellite images with 137 label categories, SatlasPretrain serves as an effective pre-training dataset that greatly reduces the effort needed to develop robust models for downstream satellite image applications.
Reference implementation:
If you use this dataset in your research, please cite the following paper:
Added in version 0.7.
Note
This dataset requires the following additional library to be installed:
AWS CLI: to download the dataset from AWS.
- __init__(root='data', split='train_lowres', good_images='good_images_lowres_all', image_times='image_times', images=('sentinel1', 'sentinel2', 'landsat'), labels=('land_cover',), transforms=None, download=False, checksum=False)[source]#
Initialize a new SatlasPretrain instance.
- Parameters:
root (str | PathLike[str]) – Root directory where dataset can be found.
split (str) – Metadata split to load.
good_images (str) – Metadata mapping between col/row and directory.
image_times (str) – Metadata mapping between directory and ISO time.
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 images is invalid.
DatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of locations in the dataset.
- Returns:
Length of the dataset
- Return type: