SHASHANGKA SHEKHAR'S BLOG

Hi, I am Shashangka Shekhar, Working with Microsoft Technologies. This is my personal blog where I share some of my experiences.

Face API Similar Face Searching Using ASP.Net MVC, AngularJS

In this tutorial, we will learn about Face API and create a simple ASP.Net MVC application to search similar face from collection of face by using Face API.

Contents already Discussed:

  • What is Cognitive Services?
  • What is Face API?
  • Sign Up for Face API
  • Create ASP.Net MVC Sample Application
    • Add AngularJS
    • Install & Configure the Face API

Please follow the below link to get all those questions in my previous post: http://shashangka.com/2017/01/08/face-api-using-asp-net-mvc

Contents to Focused:

  • Upload Multiple Candidate Face
  • List Detected Faces
  • Query Face
  • Summary

 

Open existing sample application> Right Click > Controller > Add Controller > Controller > FaceSimilarController

MVC Controller: This is where we are performing our main operation. First of all get FaceServiceKey Value from web.config by ConfigurationManager.AppSettings.

private static string ServiceKey = ConfigurationManager.AppSettings[“FaceServiceKey”];

Here in MVC Controller we have two main method to performing the face detection operation. One is HttpPost method, which is using for uploading the image file to folder and the other one is HttpGet method is using to get uploaded image and detecting faces by calling API Service.

Both methods are getting called from client script while uploading image to detect faces. Let’s get explained in steps.

Multiple Face Upload: This method is responsible for uploading multiple face image.

Face Detection: This method is responsible for detecting the faces from uploaded images.

Find Similar Faces: This method is responsible for find similar faces from facelist.

 

Finally Full MVC Controller:

MVC View:

Angular Controller:

 

Summary: You have just seen how to call Face API to detect & find faces in FaceList. Hope this will help to make application more smart and intelligent.

References:

 

One Comment

Post a comment