Friday, January 6, 2017

Sentinel Mutant Registration Facial Recognition System with Xamarin Forms and Microsoft Cognitive Services



First off, this is not a step by step tutorial for adding facial recognition to your cross platform xamarin mobile apps. For that, head on over to a blog post from Pierce Boggan: "Adding Facial Recognition to Your Mobile Apps". For another more in-depth article, head on over to "Cognitive Services - Face and Emotion Recognition in Xamarin.Forms with Microsoft Cognitive Services" from Alessandro Del Sole.

What it is, is a fun app that implements some of the face api from microsoft cognitive services - where you can subscribe to really nifty api such as face and emotion recognition. The free plans are really generous - 30k calls per month for the face api.

First and foremost, all the code can be found on github here.

Displaying Screen Shot 2017-01-06 at 5.55.11 PM.png

Introducing: Version 1 of the sentinel mutant registration program

Related image
Because of Xamarin Forms, the sentinels can be running Android, iOS or Windows. The sentinels above look like they prefer Hololens.

All the MCS Face Recognition related code can be found in the share library FaceApi folder.
You will need to implement your own ApiKeyProvider class that supplies the MCS Face Api key that you have registered.

What can you do?

  1. Clear all face registrations. This will call the DeletePersonGroupCommand, which basically deletes all face recognitions within an identified group (in this case: all the mutants)
  2. Register a new mutant. You can do this in one of two ways. Scan their face using the onboard camera, or select from a picture the device has on file. This is done via the RegisterFaceCommand
  3. Identify a mutant. Does your sentinel program need to recognize mutants for capture - this function will scan a face using the camera or file on device, and confirm whether the mutant has been registered or not. This is done via the FindGroupPeopleCommand
  4. Scan mutant. Scan a face for facial attributes such as age and  gender. Done via the DetectFaceCommand
Browse the code and add your own sentinel directives. Just don't tell Mr Eisenhardt of it's existence, lest he and the Brotherhood switch the code to hunt humans ;)