rslearn.models.ssl4eo_s12¶
ssl4eo_s12 ¶
SSL4EO-S12 models.
Ssl4eoS12 ¶
Bases: FeatureExtractor
The SSL4EO-S12 family of pretrained models.
Source code in rslearn/models/ssl4eo_s12.py
11 12 13 14 15 16 17 18 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 | |
get_backbone_channels ¶
Returns the output channels of this model when used as a backbone.
The output channels is a list of (downsample_factor, depth) that corresponds to the feature maps that the backbone returns. For example, an element [2, 32] indicates that the corresponding feature map is 1/2 the input resolution and has 32 channels.
Returns:
| Type | Description |
|---|---|
list[tuple[int, int]]
|
the output channels of the backbone as a list of (downsample_factor, depth) |
list[tuple[int, int]]
|
tuples. |
Source code in rslearn/models/ssl4eo_s12.py
forward ¶
forward(context: ModelContext) -> FeatureMaps
Compute outputs from the backbone.
If output_layers is set, then the outputs are multi-scale feature maps; otherwise, the model is being used for classification so the outputs are class probabilities and the loss.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
ModelContext
|
the model context. Input dicts must include "image" key containing the images to process. |
required |
Returns:
| Type | Description |
|---|---|
FeatureMaps
|
feature maps computed by the pre-trained model. |