i'm trying to creat numpy array from my list that contains are 1768 images. this my code:
w = []
directory = os.listdir(PATH)
directory = sorted(directory, key=len)
for item in directory:
img = Image.open(os.path.join(PATH, item))
w.append(img)
count+=1
print('w_shape: ', np.array(w, dtype='float32').shape)
and when run it, i face with this error:
TypeError: float() argument must be a string or a number, not 'JpegImageFile'
anybody can help me to solve?