public List <FaceModel> GetFaces(string knownFacePath, string unknownFacePath) { var knownFaceModels = FaceModel.Load(knownFacePath, FaceRecognition); var unknowFaceModels = FaceModel.Load(unknownFacePath, FaceRecognition); RecogniteUnknownFaceModels(knownFaceModels, unknowFaceModels); return(unknowFaceModels); }
public void RecogniteUnknownFaceModels(FaceModel knownFaceModel, FaceModel unknowFaceModel) { if (unknowFaceModel.IsRecognized == false) { if (FaceRecognition.CompareFace(knownFaceModel.Encoding, unknowFaceModel.Encoding, _tolerance)) { unknowFaceModel.Name = knownFaceModel.Name; unknowFaceModel.IsRecognized = true; } else { unknowFaceModel.Name = "unknown"; } } }