S2-100k#
- class torchgeo.datasets.S2100k(root='data', *, mode='both', transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetS2-100K dataset.
The S2-100k dataset contains 100,000 256x256 patches of 12 band Sentinel imagery sampled randomly from Sentinel 2 scenes on the Microsoft Planetary Computer that have <20% cloud cover, intersect land, and were captured between 2021-01-01 and 2023-05-17 (there are 2,359,972 such scenes).
If you use this dataset in your research, please cite the following paper:
Added in version 0.10.
- __init__(root='data', *, mode='both', transforms=None, download=False, checksum=False)[source]#
Initialize a new S2100K dataset instance.
- Parameters:
root (str | PathLike[str]) – Root directory where dataset can be found.
mode (Literal['both', 'points']) – Which data to return (options are “both” or “points”), useful for embedding locations without loading images.
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 mode argument is invalid.
DatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of datapoints in the dataset.
- Returns:
Length of the dataset.
- Return type: