The following Python code creates list of numpy array. I want to load by data sets as a numpy array that has dimension K x M x N x 3
, where K
is the index of the image and M x N x 3
is the dimension of individual image. How can I modify the existing code to do so ?
image_list=[]for filename in glob.glob(path+"/*.ppm"):img = imread(filename,mode='RGB')temp_img = img.reshape(img.shape[0]*img.shape[1]*img.shape[2],1)image_list.append(temp_img)