Skip to content

Instantly share code, notes, and snippets.

@dtkloud
Last active September 7, 2016 06:18
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 dtkloud/2fb799ced94458aaecc74b192ca21b75 to your computer and use it in GitHub Desktop.
Save dtkloud/2fb799ced94458aaecc74b192ca21b75 to your computer and use it in GitHub Desktop.
$subkey = 'yourFaceAPIkey'
$filepath = "C:\temp\DanThom_Profile.jpg"
$Splat = @{
Uri= "https://api.projectoxford.ai/vision/v1.0/analyze?visualFeatures=Faces"
Method = 'Post'
InFile = $filepath
ContentType = 'application/octet-stream'
Headers = @{'Ocp-Apim-Subscription-Key' = $subkey}
}
$faces = (Invoke-RestMethod @Splat).faces
if ($faces)
{
$FaceDetected = $True
}
if (!$faces)
{
$FaceDetected = $False
}
$FaceDetected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment