Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# We have grayscale images, so while loading the images we will keep grayscale=True, if you have RGB images, you should set grayscale as False
train_image = []
for i in tqdm(range(train.shape[0])):
img = image.load_img('train/'+train['id'][i].astype('str')+'.png', target_size=(28,28,1), color_mode="grayscale")
img = image.img_to_array(img)
img = img/255
X = np.array(train_image)
# Preprocessing the Target
y = to_categorical(y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.