Skip to content

Instantly share code, notes, and snippets.

@chadmichel
Created August 26, 2020 20:34
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/edc583bff53cea9093838fcfc44de01d to your computer and use it in GitHub Desktop.
Save chadmichel/edc583bff53cea9093838fcfc44de01d to your computer and use it in GitHub Desktop.
Find faces
static async Task Main(string[] args)
{
// create a client
var client = new FaceClient(new ApiKeyServiceClientCredentials(subKey))
{
Endpoint = endpoint
};
// image with 3 faces
var url = "https://dontpaniclabs.com/wp-content/uploads/2020/01/hero_layer.jpg";
// detect faces
var faces = await client.Face.DetectWithUrlWithHttpMessagesAsync(url, true, true);
// log # of detected faces. It should find 3 images.
Console.WriteLine(faces.Body.Count);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment