Panopticon#
- class torchgeo.models.Panopticon(attn_dim=2304, embed_dim=768, img_size=224)[source]#
Bases:
ModulePanopticon ViT-Base Foundation Model.
Added in version 0.7.
- __init__(attn_dim=2304, embed_dim=768, img_size=224)[source]#
Initialize a Panopticon model.
- Parameters:
attn_dim (int) – Dimension of channel attention.
embed_dim (int) – Embedding dimension of backbone.
img_size (int) – Image size. Panopticon can be initizialized with any image size but image size is fixed after initialization. For optimal performance, we recommend to use the same image size as used during training. For the published weights, this is 224.
- forward(x_dict)[source]#
Forward pass of the model including forward pass through the head.
- Parameters:
Dictionary with keys:
imgs: Input tensor of shape (B, C, H, W).
chn_ids: Tensor of shape (B,C) encoding the spectral information of each channel. For optical channels, this is the wavelength in nanometers. For SAR channels, this is a negative integer as outlined in Panopticon-FM/panopticon
- Returns:
Embeddings.
- Return type:
- torchgeo.models.panopticon_vitb14(weights=None, img_size=224, **kwargs)[source]#
Panopticon ViT-Base model.
Panopticon can handle arbitrary optical channel and SAR combinations. It can also be initialized with any image size where the image size is fixed after initialization. However, we recommend to set 224 in alignment with the pretraining. For more information on how to use the model, see Panopticon-FM/panopticon.
If you use this model in your research, please cite the following paper:
Added in version 0.7.
- Returns:
The Panopticon ViT-Base model with the published weights loaded.
- Return type: