LoveDA#
- class torchgeo.datasets.LoveDA(root='data', split='train', scene=['urban', 'rural'], transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetLoveDA dataset.
The LoveDA datataset is a semantic segmentation dataset.
Dataset features:
2713 urban scene and 3274 rural scene HSR images, spatial resolution of 0.3m
image source is Google Earth platform
total of 166768 annotated objects from Nanjing, Changzhou and Wuhan cities
dataset comes with predefined train, validation, and test set
dataset differentiates between ‘rural’ and ‘urban’ images
Dataset format:
images are three-channel pngs with dimension 1024x1024
segmentation masks are single-channel pngs
Dataset classes:
background
building
road
water
barren
forest
agriculture
No-data regions assigned with 0 and should be ignored.
If you use this dataset in your research, please cite the following paper:
Added in version 0.2.
- __init__(root='data', split='train', scene=['urban', 'rural'], transforms=None, download=False, checksum=False)[source]#
Initialize a new LoveDA dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – one of “train”, “val”, or “test”
scene (Sequence[str]) – specify whether to load only ‘urban’, only ‘rural’ or both
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
splitorscenearguments are invalidDatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of datapoints in the dataset.
- Returns:
length of dataset
- Return type:
- __annotate_func__()#
The type of the None singleton.