Hi @bragagnololu !
I'm trying to run your code and I've been having some issues.
What confused me kind a bit was the fact that you proposed two different models: one for forest and one for cloud detection, and they have different dimensions for the input.
Can you give me some details on why the cloud has input_size of (512, 512, 3) while the forest uses (512, 512, 4)?
Giving more details on my current issue: I've been trying to load the forest model and test it on some images, but I'm having the following issue loading the arrays on the following code:
# loading arrays
image_array = np.load("image_array_og.npy") # array of training images
image_array[image_array > 10000] = 10000
image_array = image_array.astype(float)/10000
mask_array = np.load("mask_array_og.npy") # array of training masks
channels_imgs = 4 # number of channels of one image
bands_third = np.zeros(channels_imgs)
bands_nin = np.zeros(channels_imgs)
# getting the percentiles of the training array for normalization
for i in range(channels_imgs):
bands_third[i] = np.percentile(image_array[:,:,:,i],3)
bands_nin[i] = np.percentile(image_array[:,:,:,i],97)
np.save('bands_third_og.npy', bands_third)
np.save('bands_nin_og.npy', bands_nin)
PS: I did not change the gen_npy_files.py
code, except by adding lines to save the numpy arrays into files.
My error message is the following:
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
/tmp/ipykernel_40875/54951181.py in <module>
12 # getting the percentiles of the training array for normalization
13 for i in range(channels_imgs):
---> 14 bands_third[i] = np.percentile(image_array[:,:,:,i],3)
15 bands_nin[i] = np.percentile(image_array[:,:,:,i],97)
16
IndexError: index 3 is out of bounds for axis 3 with size 3
I've experiemented reducing the dimension of the input, but then I start having problems loading the weights of the model (as expected).
I think I can make it work if you give us more details on how to run the code at the /UNet
folder.