I have ValueError: invalid literal for int() with base 10: '.DS'
error. I am looking for solutions for a day but I couldn't fix it. My directory is not empty. I am trying to train a facerecognizer using OpenCV. I am trying to get photos of faces from my train
directory but I cannot.
My code :
images = []
labels = []
for file in os.listdir('train/'):
image = cv2.imread('train/'+file, 0)
images.append(image)
labels.append(int(file.split('_')[0]))
Photos in train are named is 1_001.pmg, 1_002.pmg and so on. I am looking for your help for my silly problem. Thanks!
ps. this code is from the answer of @Fabian here how to notify user if there are common faces detected between two directories with python and opencv