Code
= load_all_images(
x, y =["sunny", "cloudy", "foggy", "rainy", "snowy"], pixels=PIXELS
classes
)# make them as numpy array
= np.array(x)
x = np.array(y)
y
# shuffle and split
= train_test_split(
x_train, x_test, y_train, y_test =0.8, shuffle=True, random_state=777
x, y, train_size
)
= y_train.copy()
y_train_labels = y_test.copy()
y_test_labels
# convert class vector into binary matrix
= to_categorical(y_test)
y_train = to_categorical(y_train)
y_test
x_train.shape, y_train.shape
((14431, 40000), (3608, 5))