You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Replace Optional[X] with X | None in get_embedding and
get_embeddings_batch signatures (api_embedding.md) and
SensorSpec signature (api_specs.md) to match Python 3.12 style
- Add complete Legacy Aliases table to models.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/api_embedding.md
+44-45Lines changed: 44 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,6 @@
2
2
3
3
This page covers single-ROI and batch embedding APIs.
4
4
5
-
6
5
Related pages: [API: Specs and Data Structures](api_specs.md), [API: Export](api_export.md), and [API: Inspect](api_inspect.md).
7
6
8
7
---
@@ -35,10 +34,10 @@ get_embedding(
35
34
model: str,
36
35
*,
37
36
spatial: SpatialSpec,
38
-
temporal: Optional[TemporalSpec]=None,
39
-
sensor: Optional[SensorSpec]=None,
40
-
fetch: Optional[FetchSpec]=None,
41
-
modality: Optional[str]=None,
37
+
temporal: TemporalSpec|None=None,
38
+
sensor: SensorSpec|None=None,
39
+
fetch: FetchSpec|None=None,
40
+
modality: str|None=None,
42
41
output: OutputSpec= OutputSpec.pooled(),
43
42
backend: str="auto",
44
43
device: str="auto",
@@ -53,30 +52,30 @@ Computes the embedding for a single ROI.
53
52
54
53
Core inputs:
55
54
56
-
| Parameter | Meaning |
57
-
|---|---|
58
-
|`model`| Model ID. See [Supported Models](models.md) or call `rs_embed.list_models()`. |
59
-
|`spatial`|`BBox` or `PointBuffer`. |
60
-
|`temporal`|`TemporalSpec` or `None`. The parameter is optional at the API level, but some models or data sources still require it. |
61
-
|`sensor`| Full input descriptor for on-the-fly models. Most precomputed models can leave this as `None`. When provided, it overrides source-level details such as collection, bands, scale, and compositing. |
62
-
|`fetch`| Lightweight sampling override for common cases such as `scale_m`, `cloudy_pct`, `composite`, and `fill_value`. It is applied on top of the model's resolved default sensor and cannot be combined with `sensor`. |
63
-
|`output`| Usually `OutputSpec.pooled()` or `OutputSpec.grid(...)`. |
|`model`| Model ID. See [Supported Models](models.md) or call `rs_embed.list_models()`.|
58
+
|`spatial`|`BBox` or `PointBuffer`.|
59
+
|`temporal`|`TemporalSpec` or `None`. The parameter is optional at the API level, but some models or data sources still require it. |
60
+
|`sensor`| Full input descriptor for on-the-fly models. Most precomputed models can leave this as `None`. When provided, it overrides source-level details such as collection, bands, scale, and compositing.|
61
+
|`fetch`| Lightweight sampling override for common cases such as `scale_m`, `cloudy_pct`, `composite`, and `fill_value`. It is applied on top of the model's resolved default sensor and cannot be combined with `sensor`. |
62
+
|`output`| Usually `OutputSpec.pooled()` or `OutputSpec.grid(...)`.|
64
63
65
64
Runtime and branch selection:
66
65
67
-
| Parameter | Meaning |
68
-
|---|---|
69
-
|`modality`| Optional model-facing modality selector such as `s1`, `s2`, or `s2_l2a` for models that expose multiple branches. The API normalizes common aliases such as `sentinel-1 -> s1` and `sentinel-2 -> s2`. |
70
-
|`backend`| Access backend. `backend="auto"` is the public default and the recommended choice. Precomputed models typically expect `auto`, while provider-backed on-the-fly paths commonly use `gee` through the auto resolver. |
71
-
|`device`|`"auto"`, `"cpu"`, or `"cuda"` for torch-backed models. |
72
-
|`input_prep`|`"resize"` (default), `"tile"`, `"auto"`, `InputPrepSpec(...)`, or `None`. `None` is treated like the default resize path. |
|`modality`| Optional model-facing modality selector such as `s1`, `s2`, or `s2_l2a` for models that expose multiple branches. The API normalizes common aliases such as `sentinel-1 -> s1` and `sentinel-2 -> s2`.|
69
+
|`backend`| Access backend. `backend="auto"` is the public default and the recommended choice. Precomputed models typically expect `auto`, while provider-backed on-the-fly paths commonly use `gee` through the auto resolver. |
70
+
|`device`|`"auto"`, `"cpu"`, or `"cuda"` for torch-backed models.|
71
+
|`input_prep`|`"resize"` (default), `"tile"`, `"auto"`, `InputPrepSpec(...)`, or `None`. `None` is treated like the default resize path. |
73
72
74
73
Model-specific settings:
75
74
76
-
| Parameter | Meaning |
77
-
|---|---|
78
-
|`variant`| Common model-specific selector passed through `**model_kwargs`, for example `variant="large"` or `variant="base"`. Only models that declare variant support accept it. |
79
-
|`**model_kwargs`| Model-specific settings passed directly as keyword arguments, such as `variant="large"`. Accepted keys depend on the model. |
|`variant`| Common model-specific selector passed through `**model_kwargs`, for example `variant="large"` or `variant="base"`. Only models that declare variant support accept it. |
78
+
|`**model_kwargs`| Model-specific settings passed directly as keyword arguments, such as `variant="large"`. Accepted keys depend on the model. |
80
79
81
80
#### Rules And Contracts
82
81
@@ -133,10 +132,10 @@ get_embeddings_batch(
133
132
model: str,
134
133
*,
135
134
spatials: List[SpatialSpec],
136
-
temporal: Optional[TemporalSpec]=None,
137
-
sensor: Optional[SensorSpec]=None,
138
-
fetch: Optional[FetchSpec]=None,
139
-
modality: Optional[str]=None,
135
+
temporal: TemporalSpec|None=None,
136
+
sensor: SensorSpec|None=None,
137
+
fetch: FetchSpec|None=None,
138
+
modality: str|None=None,
140
139
output: OutputSpec= OutputSpec.pooled(),
141
140
backend: str="auto",
142
141
device: str="auto",
@@ -151,30 +150,30 @@ Batch-computes embeddings for multiple ROIs using the same embedder instance (of
151
150
152
151
Core inputs:
153
152
154
-
| Parameter | Meaning |
155
-
|---|---|
156
-
|`model`| Model ID. See [Supported Models](models.md) or call `rs_embed.list_models()`. |
157
-
|`spatials`| Non-empty `List[SpatialSpec]`. Each item is a `BBox` or `PointBuffer`. Output order matches input order. |
158
-
|`temporal`|`TemporalSpec` or `None`. The parameter is optional at the API level, but some models or data sources still require it. |
159
-
|`sensor`| Full input descriptor for on-the-fly models. Most precomputed models can leave this as `None`. When provided, it overrides source-level details such as collection, bands, scale, and compositing. |
160
-
|`fetch`| Lightweight sampling override for common cases such as `scale_m`, `cloudy_pct`, `composite`, and `fill_value`. It is applied on top of the model's resolved default sensor and cannot be combined with `sensor`. |
161
-
|`output`| Usually `OutputSpec.pooled()` or `OutputSpec.grid(...)`. |
|`model`| Model ID. See [Supported Models](models.md) or call `rs_embed.list_models()`.|
156
+
|`spatials`| Non-empty `List[SpatialSpec]`. Each item is a `BBox` or `PointBuffer`. Output order matches input order. |
157
+
|`temporal`|`TemporalSpec` or `None`. The parameter is optional at the API level, but some models or data sources still require it. |
158
+
|`sensor`| Full input descriptor for on-the-fly models. Most precomputed models can leave this as `None`. When provided, it overrides source-level details such as collection, bands, scale, and compositing.|
159
+
|`fetch`| Lightweight sampling override for common cases such as `scale_m`, `cloudy_pct`, `composite`, and `fill_value`. It is applied on top of the model's resolved default sensor and cannot be combined with `sensor`. |
160
+
|`output`| Usually `OutputSpec.pooled()` or `OutputSpec.grid(...)`.|
162
161
163
162
Runtime and branch selection:
164
163
165
-
| Parameter | Meaning |
166
-
|---|---|
167
-
|`modality`| Optional model-facing modality selector such as `s1`, `s2`, or `s2_l2a` for models that expose multiple branches. The API normalizes common aliases such as `sentinel-1 -> s1` and `sentinel-2 -> s2`. |
168
-
|`backend`| Access backend. `backend="auto"` is the public default and the recommended choice. Precomputed models typically expect `auto`, while provider-backed on-the-fly paths commonly use `gee` through the auto resolver. |
169
-
|`device`|`"auto"`, `"cpu"`, or `"cuda"` for torch-backed models. |
170
-
|`input_prep`|`"resize"` (default), `"tile"`, `"auto"`, `InputPrepSpec(...)`, or `None`. `None` is treated like the default resize path. |
|`modality`| Optional model-facing modality selector such as `s1`, `s2`, or `s2_l2a` for models that expose multiple branches. The API normalizes common aliases such as `sentinel-1 -> s1` and `sentinel-2 -> s2`.|
167
+
|`backend`| Access backend. `backend="auto"` is the public default and the recommended choice. Precomputed models typically expect `auto`, while provider-backed on-the-fly paths commonly use `gee` through the auto resolver. |
168
+
|`device`|`"auto"`, `"cpu"`, or `"cuda"` for torch-backed models.|
169
+
|`input_prep`|`"resize"` (default), `"tile"`, `"auto"`, `InputPrepSpec(...)`, or `None`. `None` is treated like the default resize path. |
171
170
172
171
Model-specific settings:
173
172
174
-
| Parameter | Meaning |
175
-
|---|---|
176
-
|`variant`| Common model-specific selector passed through `**model_kwargs`, for example `variant="large"` or `variant="base"`. Only models that declare variant support accept it. |
177
-
|`**model_kwargs`| Model-specific settings passed directly as keyword arguments, such as `variant="large"`. Accepted keys depend on the model. |
|`variant`| Common model-specific selector passed through `**model_kwargs`, for example `variant="large"` or `variant="base"`. Only models that declare variant support accept it. |
176
+
|`**model_kwargs`| Model-specific settings passed directly as keyword arguments, such as `variant="large"`. Accepted keys depend on the model. |
0 commit comments