diff --git a/rastervision_core/rastervision/core/rv_pipeline/chip_options.py b/rastervision_core/rastervision/core/rv_pipeline/chip_options.py index da715fc2b..d3b9b5191 100644 --- a/rastervision_core/rastervision/core/rv_pipeline/chip_options.py +++ b/rastervision_core/rastervision/core/rv_pipeline/chip_options.py @@ -66,6 +66,10 @@ class WindowSamplingConfig(Config): None, description='[min, max] interval from which window widths will be ' 'uniformly randomly sampled. Only used if method = random.') + normalize: bool = Field( + True, + description='If True, the sampled chips are normalized to [0, 1] ' + 'based on their data type. Defaults to True.') max_windows: NonNegInt = Field( 10_000, description='Max number of windows to sample. Only used if ' diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/object_detection_learner_config.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/object_detection_learner_config.py index 161edfffd..43b4dc3fb 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/object_detection_learner_config.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/object_detection_learner_config.py @@ -91,6 +91,7 @@ def scene_to_dataset( stride=opts.stride, padding=opts.padding, pad_direction=opts.pad_direction, + normalize=opts.normalize, within_aoi=opts.within_aoi, transform=transform, **extra_args, @@ -103,6 +104,7 @@ def scene_to_dataset( w_lims=opts.w_lims, out_size=opts.size, padding=opts.padding, + normalize=opts.normalize, max_windows=opts.max_windows, max_sample_attempts=opts.max_sample_attempts, bbox_params=bbox_params, diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/regression_learner_config.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/regression_learner_config.py index e57ce65a2..8a26f3023 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/regression_learner_config.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/regression_learner_config.py @@ -98,6 +98,7 @@ def scene_to_dataset( stride=opts.stride, padding=opts.padding, pad_direction=opts.pad_direction, + normalize=opts.normalize, within_aoi=opts.within_aoi, transform=transform, **extra_args, @@ -110,6 +111,7 @@ def scene_to_dataset( w_lims=opts.w_lims, out_size=opts.size, padding=opts.padding, + normalize=opts.normalize, max_windows=opts.max_windows, max_sample_attempts=opts.max_sample_attempts, efficient_aoi_sampling=opts.efficient_aoi_sampling, diff --git a/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner_config.py b/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner_config.py index c377dea6c..3106ca422 100644 --- a/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner_config.py +++ b/rastervision_pytorch_learner/rastervision/pytorch_learner/semantic_segmentation_learner_config.py @@ -132,6 +132,7 @@ def scene_to_dataset(self, stride=opts.stride, padding=opts.padding, pad_direction=opts.pad_direction, + normalize=opts.normalize, within_aoi=opts.within_aoi, transform=transform, **extra_args, @@ -144,6 +145,7 @@ def scene_to_dataset(self, w_lims=opts.w_lims, out_size=opts.size, padding=opts.padding, + normalize=opts.normalize, max_windows=opts.max_windows, max_sample_attempts=opts.max_sample_attempts, efficient_aoi_sampling=opts.efficient_aoi_sampling,