Skip to content

Commit

Permalink
feat: add normalize flag to WindowSamplingConfig, used in learner con…
Browse files Browse the repository at this point in the history
…figs to create the GeoDataset
  • Loading branch information
bdevoghel authored Sep 20, 2024
1 parent 9847965 commit 516c92b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 516c92b

Please sign in to comment.