Potsdam#
- class torchgeo.datasets.Potsdam2D(root='data', split='train', transforms=None, checksum=False)[source]#
Bases:
NonGeoDatasetPotsdam 2D Semantic Segmentation dataset.
The Potsdam dataset is a dataset for urban semantic segmentation used in the 2D Semantic Labeling Contest - Potsdam. This dataset uses the “4_Ortho_RGBIR.zip” and “5_Labels_all.zip” files to create the train/test sets used in the challenge. The dataset can be requested at the challenge homepage. Note, the server contains additional data for 3D Semantic Labeling which are currently not supported.
Dataset format:
images are 4-channel geotiffs
masks are 3-channel geotiffs with unique RGB values representing the class
Dataset classes:
Clutter/background
Impervious surfaces
Building
Low Vegetation
Tree
Car
If you use this dataset in your research, please cite the following paper:
Added in version 0.2.
- __init__(root='data', split='train', transforms=None, checksum=False)[source]#
Initialize a new Potsdam 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
checksum (bool) – if True, check the MD5 of the downloaded files (may be slow)
- Raises:
AssertionError – If split is invalid.
DatasetNotFoundError – If dataset is not found.
- __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, alpha=0.5)[source]#
Plot a sample from the dataset.
- Parameters:
- Returns:
a matplotlib Figure with the rendered sample
- Return type:
- __annotate_func__()#
The type of the None singleton.