Hello!
New post for Azure Machine Learning Face APIs series
- Face APIs in Azure
- Hello Face: Face APIs in a Console App
- Hello Face: Face APIs in a WPF App
In the previous post I shared the 10 sample lines that we can user as a Face APIs basic functionality in a console app to :
- detect faces
- detect age on each face
- detect sex on each face
Moreover, another option that does Face APIs provide is the ability to identify the region on the original image for each detected face. In the next example, I’ve added a WPF project and I have referenced the ClientLibrary. It is based on one of the examples in the Face APIs SDKs.
This project has 2 important files
– lib \ FaceApiHelper.cs. This class is the one used for image processing using Face APIs service.
– UserControls \ Face.cs. Represents a User Control, with an image to show the face, and also a series of labels to show the age and sex.
The MainWindow.xaml main window features a button to select an image of the disk and by under 2 sections showing the original image with boxes on each side found and a list of the found faces. The code by pressing the button is very simple
Important: The key to use the Face API service is part of the settings of the app.
The StartFaceDetection() function returns 2 collections of Faces. One with the information age and sex of the found face, the other is a special object used to “paint” boxes on the original image.
If you’ve been able to see the code and not vomiting with error handling, you can try the application. An example of the app in operation is as follows:
If you want to see the Special transformation to paint the boxes, you can take a look at CalculateFaceRectangleForRendering() .
The code can be downloaded from https://github.com/elbruno/ProjectOxford/tree/master/Samples
Greetings @ Medrid
/El Bruno
Hi! Can you upload again the project to GitHub? Please, and thank you
LikeLike
Hi Saul,
the code is here https://github.com/elbruno/Blog/tree/master/20151125%20Project%20Oxford%20Samples
Regards
-Bruno
LikeLike