通过 Facebook 进行人脸识别 API

Face recognition via facebook API

目前,如果我在我上传的图片中标记了一个 Facebook 好友,当我上传一张带有他的脸的图片时,Facebook 会自动建议他的用户作为标签。

是否可以通过 facebook 图 api 或 SDK 模拟同样的行为?

换句话说,如果我使用 https://developers.facebook.com/docs/graph-api/reference/user/photos/ 中描述的 api 上传与我的帐户成为朋友的用户的照片("Creating" 中描述),是facebook 有什么办法可以在请求 return 参数或类似的东西中提出相同的建议?

人脸识别未通过图表公开 API,所以不,这是不可能的。

是的。您可以使用 Facematch,这是 Facebook 人脸识别功能的非官方封装。

When you upload a picture on Facebook, the /photos/tagging/recognition endpoint is called. This program uploads a private picture (using Facebook API) + calls the recognition endpoint (by simulating a browser using the user's information).

您可以使用 https://github.com/samj1912/fbrecog。 Python Facebook 人脸识别包装器。据我所知,目前唯一有效的方法。

Facebook DeepFace 人脸识别模型由 python 的 deepface 包封装。此外,该软件包还提供了一个 API 也可以称为休息服务。

!pip install deepface
from deepface import DeepFace
resp = DeepFace.verify("img1.jpg", "img2.jpg", model_name = "DeepFace")
print(resp)