convert image dataset to numpy array for cnn with labels code example
Example: transform jpg image into array for conv2d
all_images = []
for image_path in os.listdir(path):
img = io.imread(image_path , as_grey=True)
img = img.reshape([WIDTH, HEIGHT, 1])
all_images.append(img)
x_train = np.array(all_images)