Million-AID#

class torchgeo.datasets.MillionAID(root='data', task='multi-class', split='train', transforms=None, checksum=False)[source]#

Bases: NonGeoDataset

Million-AID Dataset.

The MillionAID dataset consists of one million aerial images from Google Earth Engine that offers either a multi-class learning task with 51 classes or a multi-label learning task with 73 different possible labels. For more details please consult the accompanying paper.

Dataset features:

  • RGB aerial images with varying resolutions from 0.5 m to 153 m per pixel

  • images within classes can have different pixel dimension

Dataset format:

  • images are three-channel jpg

If you use this dataset in your research, please cite the following paper:

Added in version 0.3.

__init__(root='data', task='multi-class', split='train', transforms=None, checksum=False)[source]#

Initialize a new MillionAID dataset instance.

Parameters:
  • root (str | PathLike[str]) – root directory where dataset can be found

  • task (str) – type of task, either “multi-class” or “multi-label”

  • split (str) – train or test split

  • 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:

DatasetNotFoundError – If dataset is not found.

__len__()[source]#

Return the number of data points in the dataset.

Returns:

length of the dataset

Return type:

int

__getitem__(index)[source]#

Return an index within the dataset.

Parameters:

index (int) – index to return

Returns:

data and label at that index

Return type:

dict[str, Any]

plot(sample, show_titles=True, suptitle=None)[source]#

Plot a sample from the dataset.

Parameters:
  • sample (dict[str, Any]) – a sample returned by __getitem__()

  • show_titles (bool) – flag indicating whether to show titles above each panel

  • suptitle (str | None) – optional string to use as a suptitle

Returns:

a matplotlib Figure with the rendered sample

Return type:

Figure

__annotate_func__()#

The type of the None singleton.