How to define an MLM input that depends on a preprocessing operation #7
-
With a STAC Item using MLM extension, it is possible to define a model input as such: {
"type": "Feature",
"properties": {
"mlm:input": [
{
"name": "EO Data",
"bands": ["B01", "B02", "B03", "B04", "B08", "B8A", "B09", "B11", "B12", "NDVI", "NDWI1", "NDWI2"],
"input": {
"shape": [-1, 12, 1024, 1024],
"dim_order": ["batch", "channel", "height", "width"],
"data_type": "uint16"
},
"pre_processing_function": null
}
],
"raster:bands": [
{ "name": "B01", "common_name": "coastal", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 60, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B02", "common_name": "blue", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 10, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B03", "common_name": "green", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 10, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B04", "common_name": "red", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 10, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B05", "common_name": "rededge1", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B06", "common_name": "rededge2", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B07", "common_name": "rededge3", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B08", "common_name": "nir", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 10, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B8A", "common_name": "nir08", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B09", "common_name": "nir09", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 60, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B10", "common_name": "cirrus", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 60, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B11", "common_name": "swir16", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"},
{ "name": "B12", "common_name": "swir22", "nodata": 0, "data_type": "uint16", "bits_per_sample": 15, "spatial_resolution": 20, "scale": 0.0001, "offset": 0, "unit": "m"}
]
}
} Provided that the Item also includes a However, in this specific case, the model also takes as input the NDVI, NDWI1 and NDWI2, which are themselves derived from a calculation combining the other bands:
What would be the best way to represent those calculations to define those "virtual bands". Things considered:
In both cases, the question remains, where to put the expression/algorithm? Another possibility is to define new "virtual bands" under The Should an array be permitted in |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
@m-mohr @emmanuelmathot @rbavery |
Beta Was this translation helpful? Give feedback.
The solution described in #7 (reply in thread) is now implemented in https://github.com/crim-ca/mlm-extension/releases/tag/v1.2.0