Test multiple images with "Build your First Multi-Label Image ...."

Hi! I’m using the tutorial from PULKIT SHARMA, to predict the roof material from some aerial imagery, but I have a problem with loading multiple images to the model, I’ don’t know a proper method to do it; I’m using the code that Pulkit uses to create the array of test images, but when I’m try to run the model with the test array, an error occurs, and I’m stuck, could you help me to solve this problem?

test_image = “

for i in tqdm(range(test_df.shape[0])):
img = image.load_img(‘images_test/’+test_df[‘id’][i]+’.tif’,target_size=(200,200,3))
img = image.img_to_array(img)
img = img/255
test_image.append(img)
X = np.array(test_image)

2

Error shows problem with

imshow(X)

because imshow can display only one image with size (height, width, colors) but you use array X with many images. You would have to display every image separatelly.

© Copyright 2013-2019 Analytics Vidhya