I/O Bench#
- class torchgeo.datasets.IOBench(root='data', split='preprocessed', crs=None, res=None, bands=['SR_B1', 'SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7', 'SR_QA_AEROSOL'], classes=[0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 81, 82, 83, 87, 88, 92, 111, 112, 121, 122, 123, 124, 131, 141, 142, 143, 152, 176, 190, 195, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 254], transforms=None, cache=True, download=False, checksum=False)[source]#
Bases:
IntersectionDatasetI/O Bench dataset.
I/O Bench is a dataset designed to benchmark the I/O performance of TorchGeo. It contains a single Landsat 9 scene and CDL file from 2023, and consists of the following splits
original: the original files as downloaded from USGS Earth Explorer and USDA CropScape
raw: the same files with compression and with CDL clipped to the bounds of the Landsat scene
preprocessed: the same files with compression, reprojected to the same CRS, as COGs, with TAP
If you use this dataset in your research, please cite the following paper:
Added in version 0.6.
- __init__(root='data', split='preprocessed', crs=None, res=None, bands=['SR_B1', 'SR_B2', 'SR_B3', 'SR_B4', 'SR_B5', 'SR_B6', 'SR_B7', 'SR_QA_AEROSOL'], classes=[0, 1, 2, 3, 4, 5, 6, 10, 11, 12, 13, 14, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 81, 82, 83, 87, 88, 92, 111, 112, 121, 122, 123, 124, 131, 141, 142, 143, 152, 176, 190, 195, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 254], transforms=None, cache=True, download=False, checksum=False)[source]#
Initialize a new IOBench instance.
- Parameters:
root (str | PathLike[str]) – Root directory where dataset can be found.
split (Literal['original', 'raw', 'preprocessed']) – One of ‘original’, ‘raw’, or ‘preprocessed’.
crs (CRS | None) – coordinate reference system (CRS) to warp to (defaults to the CRS of the first file found)
res (float | tuple[float, float] | None) – Resolution of the dataset in units of CRS in (xres, yres) format. If a single float is provided, it is used for both the x and y resolution. (defaults to the resolution of the first file found)
bands (Sequence[str] | None) – Bands to return (defaults to all bands).
classes (list[int]) – List of classes to include, the rest will be mapped to 0.
transforms (Callable[[dict[str, Any]], dict[str, Any]] | None) – A function/transform that takes an input sample and returns a transformed version.
cache (bool) – If True, cache file handle to speed up repeated sampling.
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 split argument is invalid.
DatasetNotFoundError – If dataset is not found and download is False.
- 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: