Inria Aerial Image Labeling#

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

Bases: NonGeoDataset

Inria Aerial Image Labeling Dataset.

The Inria Aerial Image Labeling dataset is a building detection dataset over dissimilar settlements ranging from densely populated areas to alpine towns. Refer to the dataset homepage to download the dataset.

Dataset features:

  • Coverage of 810 km2 (405 km2 for training and 405 km2 for testing)

  • Aerial orthorectified color imagery with a spatial resolution of 0.3 m

  • Number of images: 360 (train: 180, test: 180)

  • Train cities: Austin, Chicago, Kitsap, West Tyrol, Vienna

  • Test cities: Bellingham, Bloomington, Innsbruck, San Francisco, East Tyrol

Dataset format:

  • Imagery - RGB aerial GeoTIFFs of shape 5000 x 5000

  • Labels - RGB aerial GeoTIFFs of shape 5000 x 5000

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

Added in version 0.3.

Changed in version 0.5: Added support for a val split.

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

Initialize a new InriaAerialImageLabeling Dataset instance.

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

  • split (str) – train/val/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:
__len__()[source]#

Return the number of samples 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