Backbones#
Built-in Backbones#
terratorch.models.backbones.terramind.model.terramind_vit.TerraMindViT
#
Bases: Module
Modified TerraMind model, adapted to behave as a raw data-only ViT.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img_size
|
int
|
Input image size. |
224
|
modalities
|
(list, dict)
|
List of modality keys and dicts, or dict with modality keys and values being ints (num_channels of modality) or nn.Module (patch embedding layer). |
None
|
merge_method
|
str
|
Specify how the output is merged for further processing. One of 'mean', 'max', 'concat', 'dict', or None. 'mean', 'max', and 'concat' are dropping all sequence modality tokens, split all image modality tokens and reduce the by applying the appropriate method. 'dict' splits all tokens into a dictionary {'modality': torch.Tensor}. Defaults to 'mean'. |
'mean'
|
patch_size
|
int
|
Patch size. |
16
|
in_chans
|
int
|
Number of input image channels. |
3
|
dim
|
int
|
Patch embedding dimension. |
768
|
encoder_depth
|
int
|
Depth of ViT / number of encoder blocks. |
12
|
num_heads
|
int
|
Number of attention heads in each ViT block. |
12
|
mlp_ratio
|
float
|
Ratio of mlp hidden dim to embedding dim. |
4.0
|
qkv_bias
|
bool
|
If True, add a learnable bias to query, key, value. |
True
|
proj_bias
|
bool
|
If True, adds a bias to the attention out proj layer. |
True
|
mlp_bias
|
bool
|
If True, adds a learnable bias for the feedforward. |
True
|
drop_path_rate
|
float
|
Stochastic depth rate. |
0.0
|
drop_rate
|
float
|
Dropout rate. |
0.0
|
attn_drop_rate
|
float
|
Attention dropout rate. |
0.0
|
modality_drop_rate
|
float
|
Drop modality inputs during training. |
0.0
|
act_layer
|
Module
|
Activation layer. |
GELU
|
norm_layer
|
Module
|
Normalization layer. |
partial(LayerNorm, eps=1e-06)
|
gated_mlp
|
bool
|
If True, makes the feedforward gated (e.g., for SwiGLU) |
False
|
qk_norm
|
bool
|
If True, normalizes the query and keys (as in ViT-22B) |
False
|
encoder_norm
|
bool
|
If True, adds a norm layer after the last encoder block. |
True
|
tokenizer_dict
|
dict
|
Dictionary of tokenizers. |
None
|
Source code in terratorch/models/backbones/terramind/model/terramind_vit.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
forward(d=None, **kwargs)
#
Forward pass of the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
d
|
(dict, Tensor)
|
Dict of inputs or input tensor with shape (B, C, H, W) |
None
|
Returns:
Type | Description |
---|---|
list[Tensor]
|
list[torch.Tensor]: List of transformer layer outputs. Shape (B, L, D). |
Source code in terratorch/models/backbones/terramind/model/terramind_vit.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
|
init_weights()
#
Weight initialization following MAE's initialization scheme
Source code in terratorch/models/backbones/terramind/model/terramind_vit.py
terratorch.models.backbones.prithvi_mae.PrithviViT
#
Bases: Module
Prithvi ViT Encoder
Source code in terratorch/models/backbones/prithvi_mae.py
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 |
|
random_masking(sequence, mask_ratio, noise=None)
#
Perform per-sample random masking by per-sample shuffling. Per-sample shuffling is done by argsort random noise.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mask_ratio
|
float
|
mask ratio to use. |
required |
Source code in terratorch/models/backbones/prithvi_mae.py
terratorch.models.backbones.swin_encoder_decoder.MMSegSwinTransformer
#
Bases: Module
Source code in terratorch/models/backbones/swin_encoder_decoder.py
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 |
|
__init__(pretrain_img_size=224, in_chans=3, embed_dim=96, patch_size=4, window_size=7, mlp_ratio=4, depths=(2, 2, 6, 2), num_heads=(3, 6, 12, 24), strides=(4, 2, 2, 2), num_classes=1000, global_pool='avg', out_indices=(0, 1, 2, 3), qkv_bias=True, qk_scale=None, drop_rate=0.0, attn_drop_rate=0.0, drop_path_rate=0.1, act_layer=nn.GELU, norm_layer=nn.LayerNorm, with_cp=False, frozen_stages=-1)
#
MMSeg Swin Transformer backbone.
This backbone is the implementation of Swin Transformer:
Hierarchical Vision Transformer using Shifted
Windows <https://arxiv.org/abs/2103.14030>
_.
Inspiration from https://github.com/microsoft/Swin-Transformer.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pretrain_img_size
|
int | tuple[int]
|
The size of input image when pretrain. Defaults: 224. |
224
|
in_chans
|
int
|
The num of input channels. Defaults: 3. |
3
|
embed_dim
|
int
|
The feature dimension. Default: 96. |
96
|
patch_size
|
int | tuple[int]
|
Patch size. Default: 4. |
4
|
window_size
|
int
|
Window size. Default: 7. |
7
|
mlp_ratio
|
int | float
|
Ratio of mlp hidden dim to embedding dim. Default: 4. |
4
|
depths
|
tuple[int]
|
Depths of each Swin Transformer stage. Default: (2, 2, 6, 2). |
(2, 2, 6, 2)
|
num_heads
|
tuple[int]
|
Parallel attention heads of each Swin Transformer stage. Default: (3, 6, 12, 24). |
(3, 6, 12, 24)
|
strides
|
tuple[int]
|
The patch merging or patch embedding stride of each Swin Transformer stage. (In swin, we set kernel size equal to stride.) Default: (4, 2, 2, 2). |
(4, 2, 2, 2)
|
out_indices
|
tuple[int]
|
Output from which stages. Default: (0, 1, 2, 3). |
(0, 1, 2, 3)
|
qkv_bias
|
bool
|
If True, add a learnable bias to query, key, value. Default: True |
True
|
qk_scale
|
float | None
|
Override default qk scale of head_dim ** -0.5 if set. Default: None. |
None
|
patch_norm
|
bool
|
If add a norm layer for patch embed and patch merging. Default: True. |
required |
drop_rate
|
float
|
Dropout rate. Defaults: 0. |
0.0
|
attn_drop_rate
|
float
|
Attention dropout rate. Default: 0. |
0.0
|
drop_path_rate
|
float
|
Stochastic depth rate. Defaults: 0.1. |
0.1
|
act_layer
|
dict
|
activation layer. Default: nn.GELU. |
GELU
|
norm_layer
|
dict
|
normalization layer at output of backone. Defaults: nn.LayerNorm. |
LayerNorm
|
with_cp
|
bool
|
Use checkpoint or not. Using checkpoint will save some memory while slowing down the training speed. Default: False. |
False
|
frozen_stages
|
int
|
Stages to be frozen (stop grad and set eval mode). -1 means not freezing any parameters. |
-1
|
Source code in terratorch/models/backbones/swin_encoder_decoder.py
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 |
|
train(mode=True)
#
Convert the model into training mode while keep layers freezed.
terratorch.models.backbones.unet.UNet
#
Bases: Module
UNet backbone.
This backbone is the implementation of U-Net: Convolutional Networks
for Biomedical Image Segmentation <https://arxiv.org/abs/1505.04597>
_.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_channels
|
int
|
Number of input image channels. Default" 3. |
3
|
out_channels
|
int
|
Number of base channels of each stage. The output channels of the first stage. Default: 64. |
64
|
num_stages
|
int
|
Number of stages in encoder, normally 5. Default: 5. |
5
|
strides
|
Sequence[int 1 | 2]
|
Strides of each stage in encoder. len(strides) is equal to num_stages. Normally the stride of the first stage in encoder is 1. If strides[i]=2, it uses stride convolution to downsample in the correspondence encoder stage. Default: (1, 1, 1, 1, 1). |
(1, 1, 1, 1, 1)
|
enc_num_convs
|
Sequence[int]
|
Number of convolutional layers in the convolution block of the correspondence encoder stage. Default: (2, 2, 2, 2, 2). |
(2, 2, 2, 2, 2)
|
dec_num_convs
|
Sequence[int]
|
Number of convolutional layers in the convolution block of the correspondence decoder stage. Default: (2, 2, 2, 2). |
(2, 2, 2, 2)
|
downsamples
|
Sequence[int]
|
Whether use MaxPool to downsample the feature map after the first stage of encoder (stages: [1, num_stages)). If the correspondence encoder stage use stride convolution (strides[i]=2), it will never use MaxPool to downsample, even downsamples[i-1]=True. Default: (True, True, True, True). |
(True, True, True, True)
|
enc_dilations
|
Sequence[int]
|
Dilation rate of each stage in encoder. Default: (1, 1, 1, 1, 1). |
(1, 1, 1, 1, 1)
|
dec_dilations
|
Sequence[int]
|
Dilation rate of each stage in decoder. Default: (1, 1, 1, 1). |
(1, 1, 1, 1)
|
with_cp
|
bool
|
Use checkpoint or not. Using checkpoint will save some memory while slowing down the training speed. Default: False. |
False
|
conv_cfg
|
dict | None
|
Config dict for convolution layer. Default: None. |
None
|
norm_cfg
|
dict | None
|
Config dict for normalization layer. Default: dict(type='BN'). |
dict(type='BN')
|
act_cfg
|
dict | None
|
Config dict for activation layer in ConvModule. Default: dict(type='ReLU'). |
dict(type='ReLU')
|
upsample_cfg
|
dict
|
The upsample config of the upsample module in decoder. Default: dict(type='InterpConv'). |
None
|
norm_eval
|
bool
|
Whether to set norm layers to eval mode, namely, freeze running stats (mean and var). Note: Effect on Batch Norm and its variants only. Default: False. |
False
|
dcn
|
bool
|
Use deformable convolution in convolutional layer or not. Default: None. |
None
|
plugins
|
dict
|
plugins for convolutional layers. Default: None. |
None
|
pretrained
|
str
|
model pretrained path. Default: None |
None
|
init_cfg
|
dict or list[dict]
|
Initialization config dict. Default: None |
None
|
Notice
The input image size should be divisible by the whole downsample rate
of the encoder. More detail of the whole downsample rate can be found
in UNet._check_input_divisible
.
Source code in terratorch/models/backbones/unet.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 |
|
train(mode=True)
#
Convert the model into training mode while keep normalization layer freezed.
Source code in terratorch/models/backbones/unet.py
terratorch.models.backbones.mmearth_convnextv2.ConvNeXtV2
#
Bases: Module
ConvNeXt V2
Parameters:
Name | Type | Description | Default |
---|---|---|---|
in_chans
|
int
|
Number of input image channels. Default: 3 |
3
|
num_classes
|
int
|
Number of classes for classification head. Default: 1000 |
1000
|
depths
|
tuple(int
|
Number of blocks at each stage. Default: [3, 3, 9, 3] |
None
|
dims
|
int
|
Feature dimension at each stage. Default: [96, 192, 384, 768] |
None
|
drop_path_rate
|
float
|
Stochastic depth rate. Default: 0. |
0.0
|
head_init_scale
|
float
|
Init scaling value for classifier weights and biases. Default: 1. |
1.0
|
Source code in terratorch/models/backbones/mmearth_convnextv2.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
terratorch.models.backbones.dofa_vit.DOFAEncoderWrapper
#
Bases: Module
A wrapper for DOFA models from torchgeo to return only the forward pass of the encoder Attributes: dofa_model (DOFA): The instantiated dofa model Methods: forward(x: List[torch.Tensor], wavelengths: list[float]) -> torch.Tensor: Forward pass for embeddings with specified indices.
Source code in terratorch/models/backbones/dofa_vit.py
__init__(dofa_model, wavelengths, weights=None, out_indices=None)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dofa_model
|
DOFA
|
The decoder module to be wrapped. |
required |
Source code in terratorch/models/backbones/dofa_vit.py
terratorch.models.backbones.clay_v1.embedder
#
Embedder
#
Bases: Module
Source code in terratorch/models/backbones/clay_v1/embedder.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
fake_datacube()
#
Generate a fake datacube for model export.
Source code in terratorch/models/backbones/clay_v1/embedder.py
load_clay_weights(ckpt_path)
#
Load the weights from the Clay model encoder.
Source code in terratorch/models/backbones/clay_v1/embedder.py
APIs for External Models#
Tip
You find a detailed overview of all models in the TorchGeo documentation.
terratorch.models.backbones.torchgeo_vit
#
ViTEncoderWrapper
#
Bases: Module
A wrapper for ViT models from torchgeo to return only the forward pass of the encoder Attributes: satlas_model (VisionTransformer): The instantiated dofa model weights Methods: forward(x: List[torch.Tensor], wavelengths: list[float]) -> torch.Tensor: Forward pass for embeddings with specified indices.
Source code in terratorch/models/backbones/torchgeo_vit.py
__init__(vit_model, vit_meta, weights=None, out_indices=None)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dofa_model
|
DOFA
|
The decoder module to be wrapped. |
required |
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_etm_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_ETM_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_etm_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_ETM_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_etm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_ETM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_etm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_ETM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_oli_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_OLI_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_oli_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_OLI_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_oli_tirs_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_tm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_TM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eol_vit_small_patch16_224_landsat_tm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.LANDSAT_TM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eos12_vit_small_patch16_224_sentinel2_all_dino(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.SENTINEL2_ALL_DINO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
ssl4eos12_vit_small_patch16_224_sentinel2_all_moco(model_bands, pretrained=False, ckpt_data=None, weights=ViTSmall16_Weights.SENTINEL2_ALL_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_vit.py
terratorch.models.backbones.torchgeo_resnet
#
ResNetEncoderWrapper
#
Bases: Module
A wrapper for ViT models from torchgeo to return only the forward pass of the encoder Attributes: satlas_model (VisionTransformer): The instantiated dofa model weights Methods: forward(x: List[torch.Tensor], wavelengths: list[float]) -> torch.Tensor: Forward pass for embeddings with specified indices.
Source code in terratorch/models/backbones/torchgeo_resnet.py
__init__(resnet_model, resnet_meta, weights=None, out_indices=None)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dofa_model
|
DOFA
|
The decoder module to be wrapped. |
required |
Source code in terratorch/models/backbones/torchgeo_resnet.py
fmow_resnet50_fmow_rgb_gassl(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.FMOW_RGB_GASSL, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet152_sentinel2_mi_ms(model_bands, pretrained=False, ckpt_data=None, weights=ResNet152_Weights.SENTINEL2_MI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet152_sentinel2_mi_rgb(model_bands, pretrained=False, ckpt_data=None, weights=ResNet152_Weights.SENTINEL2_MI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet152_sentinel2_si_ms_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet152_Weights.SENTINEL2_SI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet152_sentinel2_si_rgb_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet152_Weights.SENTINEL2_SI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet50_sentinel2_mi_ms_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_MI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet50_sentinel2_mi_rgb_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_MI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet50_sentinel2_si_ms_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_SI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
satlas_resnet50_sentinel2_si_rgb_satlas(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_SI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
seco_resnet18_sentinel2_rgb_seco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.SENTINEL2_RGB_SECO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
seco_resnet50_sentinel2_rgb_seco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_RGB_SECO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_etm_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_ETM_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_etm_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_ETM_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_etm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_ETM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_etm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_ETM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_oli_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_OLI_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_oli_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_OLI_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_oli_tirs_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_OLI_TIRS_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_oli_tirs_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_tm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_TM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet18_landsat_tm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.LANDSAT_TM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_etm_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_ETM_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_etm_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_ETM_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_etm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_ETM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_etm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_ETM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_oli_sr_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_OLI_SR_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_oli_sr_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_OLI_SR_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_oli_tirs_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_OLI_TIRS_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_oli_tirs_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_tm_toa_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_TM_TOA_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eol_resnet50_landsat_tm_toa_simclr(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.LANDSAT_TM_TOA_SIMCLR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet18_sentinel2_all_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.SENTINEL2_ALL_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet18_sentinel2_rgb_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet18_Weights.SENTINEL2_RGB_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel1_all_decur(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL1_ALL_DECUR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel1_all_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL1_ALL_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel2_all_decur(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_ALL_DECUR, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel2_all_dino(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_ALL_DINO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel2_all_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_ALL_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
ssl4eos12_resnet50_sentinel2_rgb_moco(model_bands, pretrained=False, ckpt_data=None, weights=ResNet50_Weights.SENTINEL2_RGB_MOCO, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: ViTEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_resnet.py
terratorch.models.backbones.torchgeo_swin_satlas
#
SwinEncoderWrapper
#
Bases: Module
A wrapper for Satlas models from torchgeo to return only the forward pass of the encoder Attributes: swin_model (SwinTransformer): The instantiated dofa model weights Methods: forward(x: List[torch.Tensor], wavelengths: list[float]) -> torch.Tensor: Forward pass for embeddings with specified indices.
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
__init__(swin_model, swin_meta, weights=None, out_indices=None)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
swin_model
|
SwinTransformer
|
The backbone module to be wrapped. |
required |
swin_meta
|
dict
|
dict containing the metadata for swin. |
required |
weights
|
Weights
|
Weights class for the swin model to be wrapped. |
None
|
out_indices
|
list
|
List containing the feature indices to be returned. |
None
|
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_landsat_mi_ms(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.LANDSAT_MI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_landsat_mi_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.LANDSAT_SI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_naip_mi_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.NAIP_RGB_MI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_naip_si_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.NAIP_RGB_SI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_sentinel1_mi(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.SENTINEL1_MI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_sentinel1_si(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.SENTINEL1_SI_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_sentinel2_mi_ms(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.SENTINEL2_MI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_sentinel2_si_ms(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.SENTINEL2_SI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_b_sentinel2_si_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_B_Weights.SENTINEL2_SI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_t_sentinel2_mi_ms(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_T_Weights.SENTINEL2_MI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_t_sentinel2_mi_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_T_Weights.SENTINEL2_MI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_t_sentinel2_si_ms(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_T_Weights.SENTINEL2_SI_MS_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper
Source code in terratorch/models/backbones/torchgeo_swin_satlas.py
satlas_swin_t_sentinel2_si_rgb(model_bands, pretrained=False, ckpt_data=None, weights=Swin_V2_T_Weights.SENTINEL2_SI_RGB_SATLAS, out_indices=None, **kwargs)
#
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_bands
|
list[str]
|
A list containing the names for the bands expected by the model. |
required |
pretrained
|
bool
|
The model is already pretrained (weights are available and can be restored) or not. |
False
|
ckpt_data
|
str | None
|
Path for a checkpoint containing the model weights. |
None
|
Returns: SwinEncoderWrapper