I am trying to run the following code, but python is throwing the error that numpy has no argument 'append' for the line that says: "ids.append(id)"
path = [os.path.join("data", f) for f in os.listdir("data")]
faces = []
ids = []
for image in path :
img = Image.open(image).convert('L')
nimg = np.array(img, 'uint8')
id = int(os.path.split(image)[1].split(".")[1])
faces.append(nimg)
ids.append(id)
ids = np.array(ids)
clf = cv2.face.EigenFaceRecognizer_create()
clf.train(faces, ids)
clf.write("classifier.yml")
ids = np.array(ids)should probably be outside the loop, if needed at all. Generally, re-assignment of a different type to the same variable should involve a double-take.