Powershell + Project Oxford = Image Age and Gender Detection


Hello Readers,

In my previous post we discussed about Emotion detection using Microsoft Project Oxford  and in this Blog post we’ll continue exploring the Oxford API’s using PowerShell.

Today we’ll talk about Computer Vision API which provide state of the art algorithms to process images and return information.

 

HOW IT WORKS : 

Computer Vision API is a RESTfull API that returns Structured data when called with Proper parameters and information.

So here we’ll PassLocally Stored Image and some other parameters to the Microsoft Computer Vision API in the cloud using the Invoke-RestMethod cmdlet, which will return a structured information like in below snapshot

age

 

Structured data in above snapshot has some important attributes.

  1. FaceRectangle : This is the Rectangle’s location on the Image where the Face has been detected
  2. Age : Age of the individual face detected on the Image passed
  3. Gender : Gender of the individual face detected on the Image.

So we know the Exact Location on the Image, where a face has been detected and Age, Gender Information, now with this info in hand we can go ahead and Process the image locally and show a rectangle around the face with Age and Gender as the Label on the Image.

age

 

GET THE SCRIPTClick Here to go to my GitHub gist to get the code.

HOW TO USE IT :

Compile and Run the Script like in the animation below.

ezgif.com-optimize (1).gif

Hoping you’ll enjoy the script 🙂

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s