Example #1
0
        public async void FaceVerify(object sender, EventArgs e)
        {
            if (faceId1 == new Guid())
            {
                await FaceAddInPerson(filePath1);
            }

            // Call the Face API.
            try
            {
                var result = await _faceServiceClient.VerifyAsync(faceId2, "grupo", personId);


                await DisplayAlert("Result",
                                   "IsIdentical: " + result.IsIdentical +
                                   " Confidence: " + result.Confidence,
                                   "OK");

                await _faceServiceClient.DeletePersonFaceAsync("grupo", personId, faceId1);

                faceId1 = new Guid();
            }
            // Catch and display Face API errors.
            catch (FaceAPIException f)
            {
                await DisplayAlert("Error", f.ErrorMessage, "ok");
            }
            // Catch and display all other errors.
            catch (Exception ex)
            {
                await DisplayAlert("Error", ex.Message, "ok");
            }
        }
Example #2
0
        /// <summary>
        /// Remove face from both Cloud Face API and local whitelist
        /// </summary>
        /// <param name="personId"></param>
        /// <param name="faceId"></param>
        /// <returns></returns>
        private async Task RemoveFace(Guid personId, Guid faceId)
        {
            try {
                await _faceApiClient.DeletePersonFaceAsync(WhitelistId, personId, faceId);
            }
            catch { }

            _whitelist.RemoveFace(personId, faceId);
        }
Example #3
0
        /// <summary>
        /// Asynchronously remove the older face of a picture from oxford
        /// and update linked entity
        /// </summary>
        public async Task RemoveFaceFromOxford(Person person)
        {
            ProfilePicture pictureToDelete = _unit.ProfilePicturesRepository.GetOlderProfilePictureInOxford(person.Id);

            if (pictureToDelete == null)
            {
                return;
            }

            try
            {
                await _faceServiceClient.DeletePersonFaceAsync
                    (Global.OxfordPersonGroupId, person.PersonApiId, pictureToDelete.FaceApiId);
            }
            catch (FaceAPIException e)
            {
                LogManager.GetLogger(GetType()).Info("Error occured during suppression of a face from api", e);
            }

            pictureToDelete.FaceApiId = default(Guid);
        }
Example #4
0
 public async Task DeleteFace(Guid personId, Guid faceId)
 {
     await _faceServiceClient.DeletePersonFaceAsync(_personGroupId, personId, faceId);
 }
Example #5
0
 public Task DeletePersonFaceAsync(string personGroupId, Guid personId, Guid persistedFaceId)
 {
     return(innerClient.DeletePersonFaceAsync(personGroupId, personId, persistedFaceId));
 }