LabeledDataPrep
The labeled_data_prep key of the config.
Controls the preparation of labeled data for training.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
annotation_type | AnnotationType | yes | ||
sampler | AnnotationSampler | yes | Controls the sampling of annotated data for training. | |
window_preparer | WindowPreparer | yes | Controls the preparation of annotated spatiotemporal geometries into labeled rslearn windows. | |
data_splitter | DataSplitter | yes | Controls the splitting of labeled data into training, validation, and test sets. |
AnnotationType
Declares the expected type of training annotations. Currently represents only vector labels, but may grow to include raster.
Allowed values: "point", "polygon"
AnnotationSampler
One of the following, selected by its name field:
name | Type |
|---|---|
choose_n | ChooseNSampler |
manual | EscapeHatchComponent |
noop | NoopSampler |
WindowPreparer
One of the following, selected by its name field:
name | Type |
|---|---|
manual | EscapeHatchComponent |
standard_raster | StandardRasterWindowPreparer |
standard_vector | StandardVectorWindowPreparer |
DataSplitter
One of the following, selected by its name field:
name | Type |
|---|---|
field | FieldDataSplitter |
manual | EscapeHatchComponent |
random | RandomDataSplitter |
spatial | SpatialDataSplitter |
NoopSampler
No-op sampler that returns the full dataset.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "noop" | yes |
ChooseNSampler
Sampler that chooses a random subset of annotation tasks.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "choose_n" | yes | ||
n | integer (≥ 0) | yes | The number of samples to take |
StandardRasterWindowPreparer
Standard preparer that produces raster-labeled windows.
Combines any annotation geometry type with any windowing strategy.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "standard_raster" | yes | ||
windowing_mode | WindowingMode | yes |
StandardVectorWindowPreparer
Standard preparer that produces vector-labeled windows.
Combines any annotation geometry type with any windowing strategy.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "standard_vector" | yes | ||
windowing_mode | WindowingMode | yes |
RandomDataSplitter
Data splitter that assigns splits based on random sampling.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
train_prop | number (> 0, ≤ 1) | yes | The proportion of data to assign to the training split. | |
val_prop | number (> 0, ≤ 1) | yes | The proportion of data to assign to the validation split. | |
test_prop | number (≥ 0, ≤ 1) | yes | The proportion of data to assign to the test split. | |
name | "random" | yes | ||
seed | integer | no | 42 | The seed for the random number generator. |
SpatialDataSplitter
Data splitter that assigns splits based on spatial grid cell location.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
train_prop | number (> 0, ≤ 1) | yes | The proportion of data to assign to the training split. | |
val_prop | number (> 0, ≤ 1) | yes | The proportion of data to assign to the validation split. | |
test_prop | number (≥ 0, ≤ 1) | yes | The proportion of data to assign to the test split. | |
name | "spatial" | yes | ||
grid_size | integer (≥ 1) | yes | The size of the grid cells in pixels. |
FieldDataSplitter
Data splitter that reads pre-assigned splits from each annotation's oe_split field.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "field" | yes |
WindowingMode
One of the following, selected by its name field:
name | Type |
|---|---|
per_annotation | PerAnnotationMode |
per_group | PerGroupMode |
PerGroupMode
Windows covering the enclosing geometry of all annotations in a group.
Without gridding_strategy, produces a single window for the entire group. With gridding_strategy, divides the enclosing region into grid cells of the configured size.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "per_group" | yes | ||
gridding_strategy | GriddingStrategy | no | null | If set, divides the enclosing region into grid cells using this strategy. |
drop_inconsistent_utm | boolean | no | false | If True, skip groups where corners span different UTM zones. |
PerAnnotationMode
One window per annotation, centered on a point interior to the annotation geometry.
Uses the geometry's centroid when it falls inside the geometry. For concave polygons whose centroid lies outside the shape, falls back to a guaranteed interior point.
The window size is determined by the window_sizing strategy. Defaults to MatchInputSize, which uses input_preprocessing.default.input_size.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "per_annotation" | yes | ||
window_sizing | WindowSizing | no | {"name": "match_input_size"} | Strategy for determining the window size. |
GriddingStrategy
One of the following, selected by its name field:
name | Type |
|---|---|
center_crop | CenterCropStrategy |
pad_to_fill | PadToFillStrategy |
WindowSizing
One of the following, selected by its name field:
name | Type |
|---|---|
buffered | Buffered |
fixed_size | FixedSize |
match_input_size | MatchInputSize |
CenterCropStrategy
Crop to the largest centered rectangle that fits whole cells.
Example: 120×120 pixel region with 50×50 pixel cells
120 ÷ 50 = 2 whole cells + 20px remainder Remainder split equally: 10px margin on each side
10px 50px 50px 10px
┌─────┬──────────┬──────────┬─────┐
10px │░░░░░│░░░░░░░░░░│░░░░░░░░░░│░░░░░│
├─────┼──────────┼──────────┼─────┤
│░░░░░│ │ │░░░░░│
50px │░░░░░│ Cell 1 │ Cell 2 │░░░░░│
│░░░░░│ │ │░░░░░│
├─────┼──────────┼──────────┼─────┤
│░░░░░│ │ │░░░░░│
50px │░░░░░│ Cell 3 │ Cell 4 │░░░░░│
│░░░░░│ │ │░░░░░│
├─────┼──────────┼──────────┼─────┤
10px │░░░░░│░░░░░░░░░░│░░░░░░░░░░│░░░░░│
└─────┴──────────┴──────────┴─────┘
░░░░░ = NODATA (not included in any cell)
Result: 4 cells (2×2), each with complete valid data
Outer 10px border becomes nodata
When the region is smaller than one cell, a single cell is produced centered on the region, with padding on all sides (nodata fills naturally). This avoids dropping small tasks entirely.
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "center_crop" | yes | ||
grid_size | integer (> 0) | yes | Side length of each square grid cell in pixels. |
PadToFillStrategy
Extend edge cells beyond task bounds (nodata fills naturally).
Example: 120×120 pixel region with 50×50 pixel cells
ceil(120 ÷ 50) = 3 cells needed per dimension Grid extends 30px beyond raster on right and bottom
←─ 50px ─→←─ 50px ─→←─ 50px ─→
←20→←─30─→
valid nodata
┌──────────┬──────────┬────┬─────┐ ↑
│ │ │ │░░░░░│ │
│ Cell 1 │ Cell 2 │ │░░3░░│ 50px
│ │ │ │░░░░░│ │
├──────────┼──────────┼────┼─────┤ ↓
│ │ │ │░░░░░│ ↑
│ Cell 4 │ Cell 5 │ │░░6░░│ 50px
│ │ │ │░░░░░│ │
├──────────┼──────────┼────┼─────┤ ↓ ↑ 20px valid
│ Cell 7 │ Cell 8 │ │░░9░░│ ↓
├──────────┼──────────┼────┼─────┤ ↑ 30px nodata
│░░░░░░░░░░│░░░░░░░░░░│░░░░│░░░░░│ ↓
└──────────┴──────────┴────┴─────┘
░░░░░ = NODATA
Cells 1, 2, 4, 5: 100% valid data
Cells 3, 6: rightmost 30px = nodata
Cells 7, 8: bottom 30px = nodata
Cell 9: right 30px AND bottom 30px = nodata
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "pad_to_fill" | yes | ||
grid_size | integer (> 0) | yes | Side length of each square grid cell in pixels. |
Buffered
Window is produced by expanding the annotation geometry bounds by a fixed buffer on each side.
Point geometries: (2buffer + 1) × (2buffer + 1) window. Polygon geometries: (bbox_width + 2buffer) × (bbox_height + 2buffer) window.
Label layer is filled with nodata_value in the raster label case.
Example: buffer = 3, point annotation at ×
←─ 3 ─→ ←─ 3 ─→
┌──────────────────┐
│░░░░░░░░░░░░░░░░░░│ ↑
│░░░░░░░░░░░░░░░░░░│ 3
│░░░░░░░░░░░░░░░░░░│ ↓
│░░░░░░░░×░░░░░░░░░│
│░░░░░░░░░░░░░░░░░░│ ↑
│░░░░░░░░░░░░░░░░░░│ 3
│░░░░░░░░░░░░░░░░░░│ ↓
└──────────────────┘
Window = 7 × 7 (2*3 + 1)
Example: buffer = 3, polygon annotation (20 × 10 bbox)
←─ 3 ─→ ←─ 3 ─→
┌───────────────────────────┐
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ ↑
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 3
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ ↓
│░░░░░░┌─────────────┐░░░░░░│
│░░░░░░│ polygon │░░░░░░│
│░░░░░░│ bbox │░░░░░░│
│░░░░░░└─────────────┘░░░░░░│
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ ↑
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ 3
│░░░░░░░░░░░░░░░░░░░░░░░░░░░│ ↓
└───────────────────────────┘
Window = 26 × 16 (20+2*3) × (10+2*3)
░░░░░ = buffer region (nodata in raster labels)
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
name | "buffered" | yes | ||
buffer | integer (> 0) | yes | Buffer in pixels to add on each side of the annotation bounds. |