torchgeo.models#
This section provides an overview of all models available in torchgeo.models.
Model Architectures#
TorchGeo contains a number of model architectures depending on the task you are trying to solve and your model inputs.
1D Time Series (\(\scriptstyle B \times T \times C\))#
2D Images (\(\scriptstyle B \times C \times H \times W\))#
3D Change Detection (\(\scriptstyle B \times 2 \times C \times H \times W\))#
See torchange for additional change detection architectures.
3D Image Time Series (\(\scriptstyle B \times T \times C \times H \times W\))#
4D Ocean and Atmosphere (\(\scriptstyle B \times T \times C \times Z \times Y \times X\))#
Utility Functions#
- torchgeo.models.get_model(name, *args, **kwargs)[source]#
Get an instantiated model from its name.
Added in version 0.4.
- torchgeo.models.get_model_weights(name)[source]#
Get the weights enum class associated with a given model.
Added in version 0.4.
- torchgeo.models.get_weight(name)[source]#
Get the weights enum value by its full name.
Added in version 0.4.
- Parameters:
name (str) – Name of the weight enum entry.
- Returns:
The requested weight enum.
- Raises:
ValueError – If name is not a valid WeightsEnum.
- Return type:
WeightsEnum
Pretrained Weights#
TorchGeo provides a number of pre-trained models and backbones, allowing you to perform transfer learning on small datasets without training a new model from scratch or relying on ImageNet weights. Depending on the satellite/sensor where your data comes from, choose from the following pre-trained weights based on which one has the best performance metrics.
Sensor-Agnostic#
These weights can be used with imagery from any satellite/sensor. In addition to the usual performance metrics, there are also additional columns for dynamic spatial (resolution), temporal (time span), and/or spectral (wavelength) support, either via their training data (implicit) or via their model architecture (explicit).
Weight |
Source |
Citation |
License |
Spatial |
Temporal |
Spectral |
m-bigearthnet |
m-forestnet |
m-brick-kiln |
m-pv4ger |
m-so2sat |
m-eurosat |
m-pv4ger-seg |
m-nz-cattle |
m-NeonTree |
m-cashew-plant |
m-SA-crop |
m-chesapeake |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
CopernicusFM_Base_Weights.CopernicusFM_ViT |
CC-BY-4.0 |
explicit |
explicit |
explicit |
||||||||||||||
CROMABase_Weights.CROMA_VIT |
CC-BY-4.0 |
implicit |
implicit |
|||||||||||||||
CROMALarge_Weights.CROMA_VIT |
CC-BY-4.0 |
implicit |
implicit |
|||||||||||||||
DOFABase16_Weights.DOFA_MAE |
CC-BY-4.0 |
implicit |
explicit |
65.7 |
50.9 |
95.8 |
96.9 |
55.1 |
93.9 |
94.5 |
81.4 |
58.8 |
51.5 |
33.0 |
65.3 |
|||
DOFALarge16_Weights.DOFA_MAE |
CC-BY-4.0 |
implicit |
explicit |
67.5 |
54.6 |
96.9 |
97.3 |
60.1 |
97.1 |
95.0 |
81.8 |
59.4 |
56.9 |
32.1 |
66.3 |
|||
Panopticon_Weights.VIT_BASE14 |
Apache-2.0 |
implicit |
explicit |
56.3 |
96.7 |
96.4 |
61.7 |
96.4 |
95.2 |
92.6 |
79.6 |
59.3 |
52.6 |
78.1 |
||||
ResNet50_Weights.FMOW_RGB_GASSL |
implicit |
|||||||||||||||||
ScaleMAE_ViTLarge16_Weights.FMOW_RGB_SCALEMAE |
CC-BY-NC-4.0 |
explicit |
||||||||||||||||
Tessera_Weights.TESSERA |
CC0-1.0 |
explicit |
Landsat#
Weight |
Landsat |
Channels |
Source |
Citation |
License |
NLCD (Acc) |
NLCD (mIoU) |
CDL (Acc) |
CDL (mIoU) |
|---|---|---|---|---|---|---|---|---|---|
ResNet18_Weights.LANDSAT_TM_TOA_MOCO |
4–5 |
7 |
CC0-1.0 |
67.65 |
51.11 |
68.70 |
52.32 |
||
ResNet18_Weights.LANDSAT_TM_TOA_SIMCLR |
4–5 |
7 |
CC0-1.0 |
60.86 |
43.74 |
61.94 |
44.86 |
||
ResNet50_Weights.LANDSAT_TM_TOA_MOCO |
4–5 |
7 |
CC0-1.0 |
68.75 |
53.28 |
69.45 |
53.20 |
||
ResNet50_Weights.LANDSAT_TM_TOA_SIMCLR |
4–5 |
7 |
CC0-1.0 |
62.05 |
44.98 |
62.80 |
45.77 |
||
ViTSmall16_Weights.LANDSAT_TM_TOA_MOCO |
4–5 |
7 |
CC0-1.0 |
67.17 |
50.57 |
67.60 |
51.07 |
||
ViTSmall16_Weights.LANDSAT_TM_TOA_SIMCLR |
4–5 |
7 |
CC0-1.0 |
66.82 |
50.17 |
66.92 |
50.28 |
||
ResNet18_Weights.LANDSAT_ETM_TOA_MOCO |
7 |
9 |
CC0-1.0 |
65.22 |
48.39 |
62.84 |
45.81 |
||
ResNet18_Weights.LANDSAT_ETM_TOA_SIMCLR |
7 |
9 |
CC0-1.0 |
58.76 |
41.60 |
56.47 |
39.34 |
||
ResNet50_Weights.LANDSAT_ETM_TOA_MOCO |
7 |
9 |
CC0-1.0 |
66.60 |
49.92 |
64.12 |
47.19 |
||
ResNet50_Weights.LANDSAT_ETM_TOA_SIMCLR |
7 |
9 |
CC0-1.0 |
57.17 |
40.02 |
54.95 |
37.88 |
||
ViTSmall16_Weights.LANDSAT_ETM_TOA_MOCO |
7 |
9 |
CC0-1.0 |
63.75 |
46.79 |
60.88 |
43.70 |
||
ViTSmall16_Weights.LANDSAT_ETM_TOA_SIMCLR |
7 |
9 |
CC0-1.0 |
63.33 |
46.34 |
59.06 |
41.91 |
||
ResNet18_Weights.LANDSAT_ETM_SR_MOCO |
7 |
6 |
CC0-1.0 |
64.18 |
47.25 |
67.30 |
50.71 |
||
ResNet18_Weights.LANDSAT_ETM_SR_SIMCLR |
7 |
6 |
CC0-1.0 |
57.26 |
40.11 |
54.42 |
37.48 |
||
ResNet50_Weights.LANDSAT_ETM_SR_MOCO |
7 |
6 |
CC0-1.0 |
64.37 |
47.46 |
62.35 |
45.30 |
||
ResNet50_Weights.LANDSAT_ETM_SR_SIMCLR |
7 |
6 |
CC0-1.0 |
57.79 |
40.64 |
55.69 |
38.59 |
||
ViTSmall16_Weights.LANDSAT_ETM_SR_MOCO |
7 |
6 |
CC0-1.0 |
64.09 |
47.21 |
52.37 |
35.48 |
||
ViTSmall16_Weights.LANDSAT_ETM_SR_SIMCLR |
7 |
6 |
CC0-1.0 |
63.99 |
47.05 |
53.17 |
36.21 |
||
ResNet18_Weights.LANDSAT_OLI_TIRS_TOA_MOCO |
8–9 |
11 |
CC0-1.0 |
67.82 |
51.30 |
65.74 |
48.96 |
||
ResNet18_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR |
8–9 |
11 |
CC0-1.0 |
62.14 |
45.08 |
60.01 |
42.86 |
||
ResNet50_Weights.LANDSAT_OLI_TIRS_TOA_MOCO |
8–9 |
11 |
CC0-1.0 |
69.17 |
52.87 |
67.29 |
50.70 |
||
ResNet50_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR |
8–9 |
11 |
CC0-1.0 |
64.66 |
47.78 |
62.08 |
45.01 |
||
ViTSmall16_Weights.LANDSAT_OLI_TIRS_TOA_MOCO |
8–9 |
11 |
CC0-1.0 |
67.11 |
50.49 |
64.62 |
47.73 |
||
ViTSmall16_Weights.LANDSAT_OLI_TIRS_TOA_SIMCLR |
8–9 |
11 |
CC0-1.0 |
66.12 |
49.39 |
63.88 |
46.94 |
||
ResNet18_Weights.LANDSAT_OLI_SR_MOCO |
8–9 |
7 |
CC0-1.0 |
67.01 |
50.39 |
68.05 |
51.57 |
||
ResNet18_Weights.LANDSAT_OLI_SR_SIMCLR |
8–9 |
7 |
CC0-1.0 |
59.93 |
42.79 |
57.44 |
40.30 |
||
ResNet50_Weights.LANDSAT_OLI_SR_MOCO |
8–9 |
7 |
CC0-1.0 |
67.44 |
50.88 |
65.96 |
49.21 |
||
ResNet50_Weights.LANDSAT_OLI_SR_SIMCLR |
8–9 |
7 |
CC0-1.0 |
63.65 |
46.68 |
60.01 |
43.17 |
||
ViTSmall16_Weights.LANDSAT_OLI_SR_MOCO |
8–9 |
7 |
CC0-1.0 |
66.81 |
50.16 |
64.17 |
47.24 |
||
ViTSmall16_Weights.LANDSAT_OLI_SR_SIMCLR |
8–9 |
7 |
CC0-1.0 |
65.04 |
48.20 |
62.61 |
45.46 |
||
Swin_V2_B_Weights.LANDSAT_SI_SATLAS |
8–9 |
11 |
ODC-BY |
||||||
Swin_V2_B_Weights.LANDSAT_MI_SATLAS |
8–9 |
11 |
ODC-BY |
NAIP#
Sentinel-1#
Weight |
Channels |
Source |
Citation |
License |
|---|---|---|---|---|
ResNet50_Weights.SENTINEL1_GRD_CLOSP |
2 |
OpenRAIL |
||
ResNet50_Weights.SENTINEL1_GRD_DECUR |
2 |
Apache-2.0 |
||
ResNet50_Weights.SENTINEL1_GRD_GEOCLOSP |
2 |
OpenRAIL |
||
ResNet50_Weights.SENTINEL1_GRD_MOCO |
2 |
CC-BY-4.0 |
||
ResNet50_Weights.SENTINEL1_GRD_SOFTCON |
2 |
CC-BY-4.0 |
||
ViTSmall16_Weights.SENTINEL1_GRD_CLOSP |
2 |
OpenRAIL |
||
ViTSmall16_Weights.SENTINEL1_GRD_MAE |
2 |
CC-BY-4.0 |
||
ViTSmall16_Weights.SENTINEL1_GRD_FGMAE |
2 |
CC-BY-4.0 |
||
ViTBase16_Weights.SENTINEL1_GRD_MAE |
2 |
CC-BY-4.0 |
||
ViTBase16_Weights.SENTINEL1_GRD_FGMAE |
2 |
CC-BY-4.0 |
||
ViTLarge16_Weights.SENTINEL1_GRD_CLOSP |
2 |
OpenRAIL |
||
ViTLarge16_Weights.SENTINEL1_GRD_MAE |
2 |
CC-BY-4.0 |
||
ViTLarge16_Weights.SENTINEL1_GRD_FGMAE |
2 |
CC-BY-4.0 |
||
ViTHuge14_Weights.SENTINEL1_GRD_MAE |
2 |
CC-BY-4.0 |
||
ViTHuge14_Weights.SENTINEL1_GRD_FGMAE |
2 |
CC-BY-4.0 |
||
ViTSmall14_DINOv2_Weights.SENTINEL1_GRD_SOFTCON |
2 |
CC-BY-4.0 |
||
ViTBase14_DINOv2_Weights.SENTINEL1_GRD_SOFTCON |
2 |
CC-BY-4.0 |
||
Swin_V2_B_Weights.SENTINEL1_MI_SATLAS |
2 |
ODC-BY |
||
Swin_V2_B_Weights.SENTINEL1_SI_SATLAS |
2 |
ODC-BY |
||
Tessera_Weights.TESSERA_SENTINEL1_ENCODER |
3 |
CC0-1.0 |
Sentinel-2#
Weight |
Channels |
Source |
Citation |
License |
BigEarthNet |
EuroSAT |
So2Sat |
OSCD |
|---|---|---|---|---|---|---|---|---|
ResNet18_Weights.SENTINEL2_ALL_MOCO |
13 |
CC-BY-4.0 |
||||||
ResNet18_Weights.SENTINEL2_RGB_MOCO |
3 |
CC-BY-4.0 |
||||||
ResNet18_Weights.SENTINEL2_RGB_SECO |
3 |
Apache-2.0 |
87.27 |
93.14 |
46.94 |
|||
ResNet50_Weights.SENTINEL2_ALL_CLOSP |
13 |
OpenRAIL |
||||||
ResNet50_Weights.SENTINEL2_ALL_DECUR |
13 |
Apache-2.0 |
||||||
ResNet50_Weights.SENTINEL2_ALL_DINO |
13 |
CC-BY-4.0 |
90.7 |
99.1 |
63.6 |
|||
ResNet50_Weights.SENTINEL2_ALL_GEOCLOSP |
13 |
OpenRAIL |
||||||
ResNet50_Weights.SENTINEL2_ALL_MOCO |
13 |
CC-BY-4.0 |
91.8 |
99.1 |
60.9 |
|||
ResNet50_Weights.SENTINEL2_ALL_SOFTCON |
13 |
CC-BY-4.0 |
||||||
ResNet50_Weights.SENTINEL2_ALL_SECO_ECO |
12 |
MIT |
||||||
ResNet50_Weights.SENTINEL2_ALL_NDVI_SECO_ECO |
9 |
MIT |
||||||
ResNet50_Weights.SENTINEL2_MI_MS_SATLAS |
9 |
ODC-BY |
||||||
ResNet50_Weights.SENTINEL2_MI_RGB_SATLAS |
3 |
ODC-BY |
||||||
ResNet50_Weights.SENTINEL2_SI_MS_SATLAS |
9 |
ODC-BY |
||||||
ResNet50_Weights.SENTINEL2_SI_RGB_SATLAS |
3 |
ODC-BY |
||||||
ResNet50_Weights.SENTINEL2_RGB_MOCO |
3 |
CC-BY-4.0 |
||||||
ResNet50_Weights.SENTINEL2_RGB_SECO |
3 |
Apache-2.0 |
87.81 |
|||||
ResNet152_Weights.SENTINEL2_MI_MS_SATLAS |
9 |
ODC-BY |
||||||
ResNet152_Weights.SENTINEL2_MI_RGB_SATLAS |
3 |
ODC-BY |
||||||
ResNet152_Weights.SENTINEL2_SI_MS_SATLAS |
9 |
ODC-BY |
||||||
ResNet152_Weights.SENTINEL2_SI_RGB_SATLAS |
3 |
ODC-BY |
||||||
ViTSmall16_Weights.SENTINEL2_ALL_CLOSP |
13 |
OpenRAIL |
||||||
ViTSmall16_Weights.SENTINEL2_ALL_DINO |
13 |
CC-BY-4.0 |
90.5 |
99.0 |
62.2 |
|||
ViTSmall16_Weights.SENTINEL2_ALL_MOCO |
13 |
CC-BY-4.0 |
89.9 |
98.6 |
61.6 |
|||
ViTSmall16_Weights.SENTINEL2_ALL_MAE |
13 |
CC-BY-4.0 |
||||||
ViTSmall16_Weights.SENTINEL2_ALL_FGMAE |
13 |
CC-BY-4.0 |
||||||
ViTBase16_Weights.SENTINEL2_ALL_MAE |
13 |
CC-BY-4.0 |
||||||
ViTBase16_Weights.SENTINEL2_ALL_FGMAE |
13 |
CC-BY-4.0 |
||||||
ViTLarge16_Weights.SENTINEL2_ALL_CLOSP |
13 |
OpenRAIL |
||||||
ViTLarge16_Weights.SENTINEL2_ALL_MAE |
13 |
CC-BY-4.0 |
||||||
ViTLarge16_Weights.SENTINEL2_ALL_FGMAE |
13 |
CC-BY-4.0 |
||||||
ViTHuge14_Weights.SENTINEL2_ALL_MAE |
13 |
CC-BY-4.0 |
||||||
ViTHuge14_Weights.SENTINEL2_ALL_FGMAE |
13 |
CC-BY-4.0 |
||||||
ViTSmall14_DINOv2_Weights.SENTINEL2_ALL_SOFTCON |
13 |
CC-BY-4.0 |
||||||
ViTBase14_DINOv2_Weights.SENTINEL2_ALL_SOFTCON |
13 |
CC-BY-4.0 |
||||||
Swin_V2_T_Weights.SENTINEL2_MI_MS_SATLAS |
9 |
ODC-BY |
||||||
Swin_V2_T_Weights.SENTINEL2_MI_RGB_SATLAS |
3 |
ODC-BY |
||||||
Swin_V2_T_Weights.SENTINEL2_SI_MS_SATLAS |
9 |
ODC-BY |
||||||
Swin_V2_T_Weights.SENTINEL2_SI_RGB_SATLAS |
3 |
ODC-BY |
||||||
Swin_V2_B_Weights.SENTINEL2_MI_MS_SATLAS |
9 |
ODC-BY |
||||||
Swin_V2_B_Weights.SENTINEL2_MI_RGB_SATLAS |
3 |
ODC-BY |
||||||
Swin_V2_B_Weights.SENTINEL2_SI_MS_SATLAS |
9 |
ODC-BY |
||||||
Swin_V2_B_Weights.SENTINEL2_SI_RGB_SATLAS |
3 |
ODC-BY |
||||||
Tessera_Weights.TESSERA_SENTINEL2_ENCODER |
11 |
CC0-1.0 |
||||||
Unet_Weights.SENTINEL2_2CLASS_FTW |
8 |
CC-BY-4.0 |
||||||
Unet_Weights.SENTINEL2_2CLASS_NC_FTW |
8 |
non-commercial |
||||||
Unet_Weights.SENTINEL2_3CLASS_FTW |
8 |
CC-BY-4.0 |
||||||
Unet_Weights.SENTINEL2_3CLASS_NC_FTW |
8 |
non-commercial |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_EFNETB3 |
8 |
non-commercial |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_EFNETB5 |
8 |
non-commercial |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_EFNETB7 |
8 |
non-commercial |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_CCBY_EFNETB3 |
8 |
CC-BY-4.0 |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_CCBY_EFNETB5 |
8 |
CC-BY-4.0 |
||||||
Unet_Weights.SENTINEL2_FTW_PRUE_CCBY_EFNETB7 |
8 |
CC-BY-4.0 |
||||||
EarthLoc_Weights.SENTINEL2_RESNET50 |
3 |
MIT |
Aerial#
Weight |
Channels |
Source |
Citation |
License |
|---|---|---|---|---|
Swin_B_Weights.CITYSCAPES_SEMSEG |
3 |
CC-BY-NC-4.0 |
||
Swin_S_Weights.CITYSCAPES_SEMSEG |
3 |
CC-BY-NC-4.0 |
||
Swin_T_Weights.CITYSCAPES_SEMSEG |
3 |
CC-BY-NC-4.0 |
||
Unet_Weights.OAM_RGB_RESNET34_TCD |
3 |
CC-BY-NC-4.0 |
||
Unet_Weights.OAM_RGB_RESNET50_TCD |
3 |
CC-BY-NC-4.0 |
Atmospheric#
Weight |
Sensor |
Task |
Source |
Citation |
License |
|---|---|---|---|---|---|
Aurora_Weights.HRES_T0_PRETRAINED_AURORA |
HRES-T0 |
MWF |
MIT |
||
Aurora_Weights.HRES_T0_PRETRAINED_12HR_AURORA |
HRES-T0 |
MWF |
MIT |
||
Aurora_Weights.HRES_T0_PRETRAINED_SMALL_AURORA |
HRES-T0 |
MWF |
MIT |
||
Aurora_Weights.HRES_T0_AURORA |
HRES-T0 |
MWF |
MIT |
||
Aurora_Weights.HRES_T0_HIGH_RES_AURORA |
HRES-T0 |
MWF |
MIT |
||
Aurora_Weights.HRES_CAMS_AIR_POLLUTION_AURORA |
HRES-CAMS |
MWF |
MIT |
||
Aurora_Weights.HRES_WAM0_WAVE_AURORA |
HRES-WAM0 |
MWF |
MIT |