Created
September 8, 2020 16:16
-
-
Save chadmichel/b9b92adddaabb223348acc1197cf5ab1 to your computer and use it in GitHub Desktop.
Identity Person in image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static async Task<Person> Identify(FaceClient client, string personGroupId, string imageUrl) | |
{ | |
var detectedFaces = new List<DetectedFace>((await client.Face.DetectWithUrlAsync(imageUrl)).ToArray()); | |
var found = await client.Face.IdentifyAsync(detectedFaces.Select(df => df.FaceId).ToList(), personGroupId); | |
var personId = found.First().Candidates.First().PersonId; | |
return await client.PersonGroupPerson.GetAsync(personGroupId, personId); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment