Skip to main content

LabeledDataPrep

The labeled_data_prep key of the config.

Controls the preparation of labeled data for training.

FieldTypeRequiredDefaultDescription
annotation_typeAnnotationTypeyes
samplerAnnotationSampleryesControls the sampling of annotated data for training.
window_preparerWindowPrepareryesControls the preparation of annotated spatiotemporal geometries into labeled rslearn windows.
data_splitterDataSplitteryesControls 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:

nameType
choose_nChooseNSampler
manualEscapeHatchComponent
noopNoopSampler

WindowPreparer

One of the following, selected by its name field:

nameType
manualEscapeHatchComponent
standard_rasterStandardRasterWindowPreparer
standard_vectorStandardVectorWindowPreparer

DataSplitter

One of the following, selected by its name field:

nameType
fieldFieldDataSplitter
manualEscapeHatchComponent
randomRandomDataSplitter
spatialSpatialDataSplitter

NoopSampler

No-op sampler that returns the full dataset.

FieldTypeRequiredDefaultDescription
name"noop"yes

ChooseNSampler

Sampler that chooses a random subset of annotation tasks.

FieldTypeRequiredDefaultDescription
name"choose_n"yes
ninteger (≥ 0)yesThe number of samples to take

StandardRasterWindowPreparer

Standard preparer that produces raster-labeled windows.

Combines any annotation geometry type with any windowing strategy.

FieldTypeRequiredDefaultDescription
name"standard_raster"yes
windowing_modeWindowingModeyes

StandardVectorWindowPreparer

Standard preparer that produces vector-labeled windows.

Combines any annotation geometry type with any windowing strategy.

FieldTypeRequiredDefaultDescription
name"standard_vector"yes
windowing_modeWindowingModeyes

RandomDataSplitter

Data splitter that assigns splits based on random sampling.

FieldTypeRequiredDefaultDescription
train_propnumber (> 0, ≤ 1)yesThe proportion of data to assign to the training split.
val_propnumber (> 0, ≤ 1)yesThe proportion of data to assign to the validation split.
test_propnumber (≥ 0, ≤ 1)yesThe proportion of data to assign to the test split.
name"random"yes
seedintegerno42The seed for the random number generator.

SpatialDataSplitter

Data splitter that assigns splits based on spatial grid cell location.

FieldTypeRequiredDefaultDescription
train_propnumber (> 0, ≤ 1)yesThe proportion of data to assign to the training split.
val_propnumber (> 0, ≤ 1)yesThe proportion of data to assign to the validation split.
test_propnumber (≥ 0, ≤ 1)yesThe proportion of data to assign to the test split.
name"spatial"yes
grid_sizeinteger (≥ 1)yesThe size of the grid cells in pixels.

FieldDataSplitter

Data splitter that reads pre-assigned splits from each annotation's oe_split field.

FieldTypeRequiredDefaultDescription
name"field"yes

WindowingMode

One of the following, selected by its name field:

nameType
per_annotationPerAnnotationMode
per_groupPerGroupMode

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.

FieldTypeRequiredDefaultDescription
name"per_group"yes
gridding_strategyGriddingStrategynonullIf set, divides the enclosing region into grid cells using this strategy.
drop_inconsistent_utmbooleannofalseIf 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.

FieldTypeRequiredDefaultDescription
name"per_annotation"yes
window_sizingWindowSizingno{"name": "match_input_size"}Strategy for determining the window size.

GriddingStrategy

One of the following, selected by its name field:

nameType
center_cropCenterCropStrategy
pad_to_fillPadToFillStrategy

WindowSizing

One of the following, selected by its name field:

nameType
bufferedBuffered
fixed_sizeFixedSize
match_input_sizeMatchInputSize

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.

FieldTypeRequiredDefaultDescription
name"center_crop"yes
grid_sizeinteger (> 0)yesSide 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
FieldTypeRequiredDefaultDescription
name"pad_to_fill"yes
grid_sizeinteger (> 0)yesSide 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)
FieldTypeRequiredDefaultDescription
name"buffered"yes
bufferinteger (> 0)yesBuffer in pixels to add on each side of the annotation bounds.