for idx, face_encoding in enumerate(face_encodings):
// See if the face is a match for the known face(s)
matches = face_recognition.compare_faces(self.known_face_encodings, face_encoding)
if True in matches:
first_match_index = matches.index(True)
name = self.known_face_names[first_match_index]
matched_face_names.append(name)
// top right, lower left
loc = face_locations[idx]
// convert to left top, right bottom
matched_face_names.append(g.config["unknown_face_name"])
After Change
matched_face_rects = []
for idx,face_encoding in enumerate(face_encodings):
preds = self.svm_model.predict_proba([face_encoding])[0]
best_pred_ndx = np.argmax(preds)
best_pred = preds[best_pred_ndx]
g.logger.debug("face:{} matched with: {}".format(self.svm_model.classes_[best_pred_ndx], best_pred))
loc = face_locations[idx]
if best_pred >= g.config["face_min_confidence"]: