Powershell + Project Oxford = Image Age and Gender Detection
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 Pass a Locally 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
Structured data in above snapshot has some important attributes.
- FaceRectangle : This is the Rectangle’s location on the Image where the Face has been detected
- Age : Age of the individual face detected on the Image passed
- 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.
GET THE SCRIPT : Click 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.
Hoping you’ll enjoy the script 🙂