面部识别应用

时间:2017-06-28 09:45:20

标签: android security face-recognition

我正在尝试创建一个应用程序,当有人解锁手机并点击用户的照片(如果它不是所有者但我找不到任何合适的API)时会触发实时面部识别

1 个答案:

答案 0 :(得分:1)

您可以使用普通的面部检测或面部识别API,确保APP可以将带有内容的网址(图片)发送到以下API。

您需要订阅他们提供100个月免费请求的API,试一试:

API订阅/文档 https://market.mashape.com/zyanyatech1/face-recognition

请求如下:

# 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\"}")
)

回复将是:

 {
  "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
    }
  ]
}