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], transforms=None, cache=True, download=False, checksum=False)[source]#

Bases: IntersectionDataset

I/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], 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 (str) – 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:
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:

Figure

__annotate_func__()#

The type of the None singleton.