I'm building a fully convolutional neural network that inputs and outputs an image. I want my images to be of the different sizes and resizing or adding padding doesn't suit me.
As it was said here: Can Keras deal with input images with different size?, I can build such a model specifying input_shape = (1, None, None), but how should I prepare a dataset that I feed to my network?
I have this function for loading images for fixed image size:
def load_images(path): all_images = [] for image_path in sorted(os.listdir(path)): img = imread(path + image_path , as_gray=True) all_images.append(img) return np.array(all_images).reshape(len(all_images),img_size,img_size,1) How should I change it so that 2 dimensions of the output numpy array are not fixed? np.reshape allows only one dimension to be unknown.