Example #1
0
        async Task GetSimilarFaces()
        {
            var detectSelectedPersonRes = await FaceApiService.DetectFaces(PersonSelected.FaceImageUrl);

            var similarFaces = await FaceApiService.GetSimilarFaces(detectSelectedPersonRes.FirstOrDefault().FaceId);

            List <Person> similarPersons = new List <Person>();

            foreach (var similarFace in similarFaces)
            {
                var person = Persons.FirstOrDefault(p => p.LargeListFaceId == similarFace.PersistedFaceId);
                if (person != null)
                {
                    person.ConfidenceSimilarity = similarFace.Confidence.ToString();
                    similarPersons.Add(person);
                }
            }

            SimilarPersons = new ObservableCollection <Person>(similarPersons);
        }