transform jpg image into array for conv2d

Solutions on MaxInterview for transform jpg image into array for conv2d by the best coders in the world

showing results for - "transform jpg image into array for conv2d"
Mattia
03 Jul 2020
1all_images = []
2for image_path in os.listdir(path):
3  img = io.imread(image_path , as_grey=True)
4  img = img.reshape([WIDTH, HEIGHT, 1])
5  all_images.append(img)
6x_train = np.array(all_images)
7