Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add normalize flag to WindowSamplingConfig #2246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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