Created
January 5, 2017 14:14
-
-
Save babo/d6632689adeebb97a39ef0818b01b6f9 to your computer and use it in GitHub Desktop.
Import images using cv2
This file contains hidden or 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
import os | |
import cv2 | |
import numpy as np | |
own_pictures = [] | |
dirname = './extra_images/' | |
for fn in os.listdir(dirname): | |
try: | |
img = cv2.imread(os.path.join(dirname, fn)) | |
img = cv2.resize(img, (32, 32)) | |
own_pictures.append(np.array(img)) | |
except Exception as e: | |
pass | |
own_pictures = np.asarray(own_pictures) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment