Last active
July 23, 2021 07:02
-
-
Save VedPDubey/b3f2f956beb0e22a40a4693e1057b5a7 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
def load_data(): | |
images, labels = [], [] | |
for dataset in datasets: | |
for folder in os.listdir(dataset): | |
label = class_name_labels[folder] | |
for file in tqdm(os.listdir(os.path.join(dataset,folder))): | |
img_path = os.path.join(dataset,folder,file) | |
img = cv2.imread(img_path) | |
img = cv2.resize(img, (96,96)) | |
images.append(img) | |
labels.append(label) | |
pass | |
pass | |
images = np.array(images,dtype=np.float32)/255.0 | |
labels = np.array(labels,dtype=np.float32) | |
pass | |
return (images, labels) | |
pass | |
(images, labels) = load_data() | |
images.shape, labels.shape |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment