SODA#

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

Bases: NonGeoDataset

SODA-A dataset.

The SODA-A dataset is a high resolution aerial imagery dataset for small object detection.

Dataset features:

  • 2513 images

  • 872,069 annotations with oriented bounding boxes

  • 9 classes

Dataset format:

  • Images are three channel .jpg files.

  • Annotations are in json files

Classes:

  1. Airplane

  2. Helicopter

  3. Small vehicle

  4. Large vehicle

  5. Ship

  6. Container

  7. Storage tank

  8. Swimming-pool

  9. Windmill

  10. Other

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

Added in version 0.7.

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

Initialize a new instance of SODA-A dataset.

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

  • split (Literal['train', 'val', 'test']) – one of “train”, “val”, or “test”

  • bbox_orientation (Literal['oriented', 'horizontal']) – one of “oriented” or “horizontal”

  • 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 samples in the dataset.

__getitem__(index)[source]#

Return the sample at the given index.

Parameters:

index (int) – index of the sample to return

Returns:

the sample at the given 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 with legend.

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