-
-
Save amankharwal/d8c23cfb2e899a7f89ffc2dafb72acdb 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
data = [] | |
label = [] | |
SIZE = 128 #Crop the image to 128x128 | |
for folder in os.listdir(folder_dir): | |
for file in os.listdir(os.path.join(folder_dir, folder)): | |
if file.endswith("jpg"): | |
label.append(folder) | |
img = cv2.imread(os.path.join(folder_dir, folder, file)) | |
img_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) | |
im = cv2.resize(img_rgb, (SIZE,SIZE)) | |
data.append(im) | |
else: | |
continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment