-
-
Save HSShashank/a9ad80e0f5d5d31199101a88e4742ce6 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
X_data = df['IMAGE PATH'] | |
y_data = df['MAPPED LABELS'] | |
X_train, X_test, y_train, y_test = train_test_split(X_data, y_data, shuffle=True, test_size=0.01,stratify=y_data) | |
#Creating numpy arrays of images | |
X = [] | |
y = [] | |
for i in X_train: | |
X.append(cv2.imread(i)) | |
for i in y_train: | |
y.append(i) | |
X = np.array(X) | |
y = np.array(y) | |
# Converting the labels vector to one-hot format | |
y = keras.utils.to_categorical(y, 5) | |
print(f"Total number of Images: {len(X_data)}") | |
print(f"Number of Training Images: {len(X_train)}") | |
print(f"Number of Test Images: {len(X_test)}") # Saving a small number of images for model testing| | |
print(f"Shape of Images: {X[0].shape}") #Printing the shape of Images |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment