Replies: 1 comment 2 replies
-
In Raster Vision, this is accomplished via a For normalization, see StatsTransformer tutorial. Example: stats_tf_s1 = ... # see the StatsTransformer tutorial
stats_tf_s2 = ... # see the StatsTransformer tutorial
rs_sentinel_1 = RasterioSource(s1_uri, raster_transformers=[stats_tf_s1])
rs_sentinel_2 = RasterioSource(s2_uri, raster_transformers=[stats_tf_s2])
rs_ndvi = RasterioSource(
ndvi_uri,
# just an example, you can also write a custom transformer
# see https://github.com/azavea/raster-vision/tree/master/rastervision_core/rastervision/core/data/raster_transformer
raster_transformers=[MinMaxTransformer()],
)
raster_sources = [
rs_seninel_1,
rs_sentinel_2,
rs_ndvi,
]
raster_source_multi = MultiRasterSource(raster_sources=raster_sources) You will then need to create a label_raster_source = RasterioSource(label_uri)
label_source = SemanticSegmentationLabelSource(
label_raster_source, class_config=class_config)
scene = Scene(id='my_scene', raster_source=raster_source, label_source=label_source) And then finally, create a GeoDataset e.g.: ds = SemanticSegmentationSlidingWindowGeoDataset(
scene,
size=256,
stride=256,
# ... etc.
) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following this example here:
if we have multiple raster files how can we create the
train_ds
train dataset. I am trying to use rastervision as a library following the example.What's the way to build dataset in such scenarios?
Also, if there are scenarios, where we have sentinel-1 data(2 channels) and sentinel-2 data (3 channels and it has difference scale of numbers from sentinel-1) and NDVI ([-1,+1] value ranges), what is the best way to include them in the dataset so it all comes up as (2+3+1 = ) 6 channel tensor finally with normalized values as per their own data (NDVI normalization is different than sentinel-1 normalization etc) ?
Beta Was this translation helpful? Give feedback.
All reactions