USAVars#
- class torchgeo.datasets.USAVars(root='data', split='train', labels=('treecover', 'elevation', 'population'), transforms=None, download=False, checksum=False)[source]#
Bases:
NonGeoDatasetUSAVars dataset.
The USAVars dataset is reproduction of the dataset used in the paper “A generalizable and accessible approach to machine learning with global satellite imagery”. Specifically, this dataset includes 1 sq km. crops of NAIP imagery resampled to 4m/px cenetered on ~100k points that are sampled randomly from the contiguous states in the USA. Each point contains three continuous valued labels (taken from the dataset released in the paper): tree cover percentage, elevation, and population density.
Dataset format:
images are 4-channel GeoTIFFs
labels are singular float values
Dataset labels:
tree cover
elevation
population density
If you use this dataset in your research, please cite the following paper:
Added in version 0.3.
- __init__(root='data', split='train', labels=('treecover', 'elevation', 'population'), transforms=None, download=False, checksum=False)[source]#
Initialize a new USAVars dataset instance.
- Parameters:
root (str | PathLike[str]) – root directory where dataset can be found
split (str) – train/val/test split to load
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 invalid labels are provided
DatasetNotFoundError – If dataset is not found and download is False.
- __len__()[source]#
Return the number of data points in the dataset.
- Returns:
length of the dataset
- Return type:
- __annotate_func__()#
The type of the None singleton.