IOError: cannot identify image file 'dataSet/.DS_Store [closed]
I have code as follows :
import os
import cv2
import numpy as np
from PIL import Image
path = 'data'
def grabImage(path):
imagePaths=[os.path.join(path,f) for f in os.listdir(path)]
faces=[]
IDs=[]
for imagePath in imagePaths:
faceImg=Image.open(imagePath).convert('L')
return IDs, faces
IDs,faces=grabImage(path)
I get error as follows :
Traceback (most recent call last):
File "t.py", line 24, in <module>
IDs,faces=grabImage(path)
File "t.py", line 14, in F
faceImg=Image.open(imagePath).convert('L')
File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 2452, in open
% (filename if filename else fp))
IOError: cannot identify image file 'data/.DS_Store'
So on searching I realised .DS_Store is hidden file type in MacOS and hence the error, but I don't understand what needs to be done to get rid of it?
entirely unrelated to opencv (and thus the wrong place to ask)
glob