DIOR#

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

Bases: NonGeoDataset

DIOR dataset.

DIOR dataset contains horizontal bounding box annotations of Google Earth Aerial RGB imagery. The test split does not contain bounding box annotations and labels.

Dataset features:

  • 20 classes

  • 192,472 manually annotated bounding box instances

Dataset format:

Classes:

  1. Airplane

  2. Airport

  3. Baseball Field

  4. Basketball Court

  5. Bridge

  6. Chimney

  7. Dam

  8. Expressway Service Area

  9. Expressway Toll Station

  10. Golf Field

  11. Ground Track Field

  12. Harbor

  13. Overpass

  14. Ship

  15. Stadium

  16. Storage Tank

  17. Tennis Court

  18. Train Station

  19. Vehicle

  20. Windmill

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

Added in version 0.7.

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

Initialize a new DIOR dataset instance.

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

  • split (Literal['train', 'val', 'test']) – split of the dataset to use, one of ‘train’, ‘val’, ‘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

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

__annotate_func__()#

The type of the None singleton.

plot(sample, show_titles=True, suptitle=None, box_alpha=0.7)[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

  • box_alpha (float) – alpha value for boxes

Returns:

a matplotlib Figure with the rendered sample

Return type:

Figure