rslearn.models.terramind¶
terramind ¶
Terramind models.
TerramindSize ¶
Terramind ¶
Bases: FeatureExtractor
Terramind backbones.
Source code in rslearn/models/terramind.py
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 | |
forward ¶
forward(context: ModelContext) -> FeatureMaps
Forward pass for the Terramind model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
context
|
ModelContext
|
the model context. Input dicts must include modalities as keys which are defined in the self.modalities list. |
required |
Returns:
| Type | Description |
|---|---|
FeatureMaps
|
a FeatureMaps with one feature map from the encoder, at 1/16 of the input resolution. |
Source code in rslearn/models/terramind.py
get_backbone_channels ¶
Returns the output channels of this model when used as a backbone.
The output channels is a list of (patch_size, depth) that corresponds to the feature maps that the backbone returns.
Returns:
| Type | Description |
|---|---|
list
|
the output channels of the backbone as a list of (patch_size, depth) tuples. |
Source code in rslearn/models/terramind.py
TerramindNormalize ¶
Bases: Transform
Normalize inputs using Terramind normalization.
It will apply normalization to the modalities that are specified in the model configuration.
Source code in rslearn/models/terramind.py
apply_image ¶
Normalize the specified image with Terramind normalization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
image
|
Tensor
|
the image to normalize. |
required |
means
|
list[float]
|
the means to use for the normalization. |
required |
stds
|
list[float]
|
the standard deviations to use for the normalization. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
The normalized image. |
Source code in rslearn/models/terramind.py
forward ¶
forward(input_dict: dict[str, Any], target_dict: dict[str, Any]) -> tuple[dict[str, Any], dict[str, Any]]
Normalize the specified image with Terramind normalization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_dict
|
dict[str, Any]
|
the input dictionary. |
required |
target_dict
|
dict[str, Any]
|
the target dictionary. |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any], dict[str, Any]]
|
normalized (input_dicts, target_dicts) tuple |