Hello, ran into 2 issues when running DeepWaterMap that I think are easily resolvable.
If the image is exactly divisible by 32, then the padding indices are pad_r == (0,0) and pad_c = (0,0). This causes a problem when trying to use these padding indices to resize the output image as indexing dwm = dwm[0:-0, 0:-0] returns an empty array. So by checking for 0s in the second values for the padding arrays and setting them to 1 if needed, this issue is resolved because dwm = dwm[0:-1, 0:-1] will return the entire array.
If there are any NaN or infinity values in the input image, then the pre-processing step where the image is normalized can turn the entire array into NaNs. One potential fix is to check for an NaNs or infinity values and raise an error right after loading the image, I propose simply replacing the values with 0s if they are present instead.
These fixes appear to have resolved the problems I was running into. Again, not sure if they are the best solutions, but they're working for me.
Hello, ran into 2 issues when running DeepWaterMap that I think are easily resolvable.
If the image is exactly divisible by 32, then the padding indices are
pad_r == (0,0)
andpad_c = (0,0)
. This causes a problem when trying to use these padding indices to resize the output image as indexingdwm = dwm[0:-0, 0:-0]
returns an empty array. So by checking for 0s in the second values for the padding arrays and setting them to 1 if needed, this issue is resolved becausedwm = dwm[0:-1, 0:-1]
will return the entire array.If there are any NaN or infinity values in the input image, then the pre-processing step where the image is normalized can turn the entire array into NaNs. One potential fix is to check for an NaNs or infinity values and raise an error right after loading the image, I propose simply replacing the values with 0s if they are present instead.
These fixes appear to have resolved the problems I was running into. Again, not sure if they are the best solutions, but they're working for me.