Search code examples
androidsecurityface-recognition

Face Recognition app


I am trying to make an app which will trigger live face recognition when someone unlocks the phone and click a photo of the user if it is not the owner but i can't find any suitable API's for it


Solution

  • You could use a normal face detection or face recognition API, make sure the APP can send a url with the content on it (image) to the following API.

    You will need to subscribe to the API they offer 100 monthly free requests, give it a try:

    API Subscribe / Documentation https://market.mashape.com/zyanyatech1/face-recognition

    The request is as follows:

    # These code snippets use an open-source library. http://unirest.io/python
    response = unirest.post("https://zyanyatech1-face-recognition-v1.p.mashape.com/facebox/check",
      headers={
        "X-Mashape-Key": "{subscription_key}",
        "Content-Type": "application/json",
        "Accept": "application/json"
      },
      params=("{\"url\":\"https://upload.wikimedia.org/wikipedia/commons/d/df/The_Fabs.JPG\"}")
    )
    

    The response will be:

     {
      "success": true,
      "facesCount": 4,
      "faces": [
        {
          "rect": {
            "top": 737,
            "left": 117,
            "width": 223,
            "height": 223
          },
          "matched": false
        },
        {
          "rect": {
            "top": 171,
            "left": 735,
            "width": 268,
            "height": 268
          },
          "matched": false
        },
        {
          "rect": {
            "top": 762,
            "left": 687,
            "width": 223,
            "height": 223
          },
          "matched": false
        },
        {
          "rect": {
            "top": 134,
            "left": -44,
            "width": 356,
            "height": 321
          },
          "matched": false
        }
      ]
    }