import numpy as np import cv2 import os instances = [] # Load in the images for filepath in os.listdir('images/'): instances.append(cv2.imread('images/{0}'.format(filepath),0)) print(type(instances[0]))