Skip to content

Instantly share code, notes, and snippets.

@Rodio346
Created August 12, 2021 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Rodio346/40258ffdcff1fdde1adb459c8e9d8be4 to your computer and use it in GitHub Desktop.
Save Rodio346/40258ffdcff1fdde1adb459c8e9d8be4 to your computer and use it in GitHub Desktop.
data = []
labels = []
for img in Whales:
try:
img_read = plt.imread('Final Whale Dataset/Yes/' + img)
img_resize = cv2.resize(img_read, (50, 50))
img_array = img_to_array(img_resize)
data.append(img_array)
labels.append(1)
except:
None
for img in Not_whales:
try:
img_read = plt.imread('Final Whale Dataset/No/' + img)
img_resize = cv2.resize(img_read, (50, 50))
img_array = img_to_array(img_resize)
data.append(img_array)
labels.append(0)
except:
None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment