// 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]
After Change
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"]:
matched_face_names.append(self.svm_model.classes_[best_pred_ndx])
else:
g.logger.debug ("face confidence is less than {}, marking it unknown".format(g.config["face_min_confidence"]))
matched_face_names.append(g.config["unknown_face_name"])
matched_face_rects.append((loc[3], loc[0], loc[1], loc[2]))
conf.append(best_pred)