LEVIR-CD#
- class torchgeo.datasets.LEVIRCDBase(root='data', split='train', transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDataset,ABCAbstract base class for the LEVIRCD datasets.
Added in version 0.6.
- __init__(root='data', split='train', transforms=None, download=False, checksum=False)[source]#
Initialize a new LEVIR-CD base dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – one of “train” 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.
- __getitem__(index)[source]#
Return an index within the dataset.
Changed in version 0.8: Now returns a single T x C x H x W image.
- __len__()[source]#
Return the number of data points in the dataset.
- Returns:
length of the dataset
- Return type:
- plot(sample, show_titles=True, suptitle=None)[source]#
Plot a sample from the dataset.
- Parameters:
- Returns:
a matplotlib Figure with the rendered sample
- Return type:
Added in version 0.2.
- __annotate_func__()#
The type of the None singleton.
- class torchgeo.datasets.LEVIRCD(root='data', split='train', transforms=None, download=False, checksum=False)[source]#
Bases:
LEVIRCDBaseLEVIR-CD dataset.
The LEVIR-CD dataset is a dataset for building change detection.
Dataset features:
image pairs of 20 different urban regions across Texas between 2002-2018
binary change masks representing building change
three spectral bands - RGB
637 image pairs with 50 cm per pixel resolution (~1024x1024 px)
Dataset format:
images are three-channel pngs
masks are single-channel pngs where no change = 0, change = 255
Dataset classes:
no change
change
If you use this dataset in your research, please cite the following paper:
Added in version 0.6.
- __annotate_func__()#
The type of the None singleton.