Last active
March 17, 2020 10:51
-
-
Save frenzy2106/80348f59aaffa224e979dc12c9851398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
train_image.append(img) | |
X = np.array(train_image) | |
# Preprocessing the Target | |
y=train['label'].values | |
y = to_categorical(y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment