Major TOM Embeddings#

class torchgeo.datasets.MajorTOMEmbeddings(root='data', transforms=None)[source]#

Bases: NonGeoDataset

Major TOM Embeddings dataset.

Major TOM (Terrestrial Observation Metaset) is a standard for curating, sharing and combining large-scale EO datasets. This data loader provides access to the official embedding datasets created using Major TOM Core and several existing foundation models.

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

Added in version 0.9.

__init__(root='data', transforms=None)[source]#

Initialize a new MajorTOMEmbeddings instance.

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

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

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)[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.

Returns:

A matplotlib Figure with the rendered sample.

Return type:

Figure