EarthLoc#

class torchgeo.models.EarthLoc(in_channels=3, image_size=320, desc_dim=4096, backbone='resnet50', pretrained=False)[source]#

Bases: Module

EarthLoc model for generating feature descriptors from satellite imagery.

Adapted from gmberton/EarthLoc. Copyright (c) 2024 Gabriele Berton

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

Added in version 0.8.

__init__(in_channels=3, image_size=320, desc_dim=4096, backbone='resnet50', pretrained=False)[source]#

Initialize the EarthLoc model.

Parameters:
  • in_channels (int) – Number of input channels in the images (default: 3 for RGB).

  • image_size (int) – Size of the input images (assumed square).

  • desc_dim (int) – Dimension of the final output feature descriptor.

  • backbone (str) – Backbone model to use for feature extraction (default: “resnet50”).

  • pretrained (bool) – Whether to use pre-trained weights for the backbone model.

forward(x)[source]#

Forward pass of the EarthLoc model.

Parameters:

x (Tensor) – Input tensor of shape (b, c, h, w).

Returns:

Output feature descriptor tensor of shape (b, desc_dim).

Return type:

Tensor

torchgeo.models.earthloc(weights=None, *args, **kwargs)[source]#

EarthLoc model.

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

Added in version 0.8.

Parameters:
  • weights (EarthLoc_Weights | None) – Pre-trained model weights to use.

  • *args (Any) – Additional arguments to pass to EarthLoc.

  • **kwargs (Any) – Additional keyword arguments to pass to EarthLoc.

Returns:

An EarthLoc model.

Return type:

EarthLoc

class torchgeo.models.EarthLoc_Weights(*values)[source]#

Bases: WeightsEnum

EarthLoc weights.

__new__(value)#