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 raster metrics results organization module #78

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Change raster loader to not flatten patches; change flattened pixel v…
…alue extractor to scale based on min max #58
  • Loading branch information
bdubayah committed Nov 2, 2021
commit 15a3b19cf02dbe63d47044f1ed9af668f2945ca1
2 changes: 1 addition & 1 deletion dora_exp_pipeline/dora_data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _load(self, dir_path: str, patch_size: int, stride: int = 1,
# append the patch coordinate as the id
data_dict['id'].append('%d-%d' % (i, j))
# append the patch data
data_dict['data'].append(patch.flatten())
data_dict['data'].append(patch)
j += stride
i += stride
else:
Expand Down
5 changes: 4 additions & 1 deletion dora_exp_pipeline/dora_feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ def extract(self, data_cube, **kwargs):
ret_features[ind, :] = data.flatten()

if kwargs.get('normalize_pixels'):
ret_features = ret_features / 255.
min_val = np.min(ret_features)
max_val = np.max(ret_features)
scaled = np.subtract(ret_features, min_val) / (max_val - min_val)
ret_features = scaled

return ret_features

Expand Down