http://www.how-old.net has been trending recently in social media. Simply you can upload a picture in this website and it will detect the faces in the photo and tells you the gender and the age of the person the face belongs to.
The site uses Face API behind the scenes, which is available here http://gallery.azureml.net/MachineLearningAPI/b0b2598aa46c4f44a08af8891e415cc7
You can try this service by subscribing to the service. It’s an App Service in Microsoft Azure and you need to have a Azure subscription to subscribed to that. Currently it is free and you are allowed to make 20 transactions per minute for the subscription.
Once you are done with the purchase like any other service Face API is available in the Azure Marketplace section.
In the management section you can get the key for the API, the Face API is managed by Azure API Management (read more about Azure API Management here)
Face API teams also provides a sample WPF application with the portable client library as a wrapper for their REST service.
Getting Started with the Face API .NET client SDK
A simple face detection method would be very similar to this.
var faceClient = new FaceServiceClient("<your subscription key>"); var faces = await faceClient.DetectAsync(fileStream, false, true, true, false); var collection = new List<MyFaceModel>(); foreach (var face in faces) { collection.Add(new MyFaceModel() { FaceId = face.FaceId.ToString(), Gender = face.Attributes.Gender, Age = face.Attributes.Age }); }
A direct JSON output would be like this. (test it here – http://www.projectoxford.ai/demo/face)
Face detection is made immensely easy by this research project. 🙂 Happy face detection.
The library has loads of other features like matching faces, grouping highlighting and all.