diff --git a/minigrida/descriptors/sdaps.py b/minigrida/descriptors/sdaps.py index 6520e08..c9ace76 100644 --- a/minigrida/descriptors/sdaps.py +++ b/minigrida/descriptors/sdaps.py @@ -42,6 +42,11 @@ def run(gt, rasters, coords, remove, attributes, adjacency='4', filtering='direc X_raw = np.moveaxis(np.array(list(eap.vectorize())), 0, -1) y_raw = gti + if np.isnan(X_raw).any(): + raise Exception('Found {} Nan on {}'.format(np.isnan(X_raw).sum(), + coordsi)) + + # Remove unwanted label X, y lbl = np.ones_like(y_raw, dtype=np.bool) for l in remove if remove else []: @@ -51,7 +56,7 @@ def run(gt, rasters, coords, remove, attributes, adjacency='4', filtering='direc y += [y_raw[lbl]] groups += [np.repeat(coordsi, lbl.sum())] - X = np.concatenate(X).astype(np.float32) + X = np.concatenate(X) y = np.concatenate(y) groups = np.concatenate(groups)