In this article you will learn how to get the image attributes like Age, Gender using Cognitive Services face API in WPF.
To know about Cognitive Services Face API, you must read this article first.
Getting Started
As I discussed in my previous article, how to add Newston.json and ProjectOxford.Face and you need a subscription of Cognitive Service Face preview and copy the subscription key. Once you are done with all this then let’s move to the .xaml page.
In my xaml code I have image control and a button, once I click on the button we will get all image attributes in textblocks.
Let’s work on code part now.
Run the project.
Click on Get details button to get the all attribute details.
As you can see in given screenshot we have Id, Attributes, Age, Gender, Smile, Facial hair, Head Pose, Glasses. I am showing only few things here not showing attributes, facial hair and head pose.
I wonder I know my real age now :)
Conclusion - In this article, we have seen how to use Microsoft Cognitive Service face API in WPF to get image attributes. If you have any question or comments, drop me a comment or message in C# corner comments section.
Pro WPF: Windows Presentation Foundation in .NET 3.0