Skip to content

Instantly share code, notes, and snippets.

@chadmichel
Created September 8, 2020 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadmichel/b9b92adddaabb223348acc1197cf5ab1 to your computer and use it in GitHub Desktop.
Save chadmichel/b9b92adddaabb223348acc1197cf5ab1 to your computer and use it in GitHub Desktop.
Identity Person in image
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