我在1,000张测试图像上从Google和Amazon运行面部检测API。在results中,Google的误报率非常高。
一些例子:
Google:https://obj-manip.cs.princeton.edu/results/test/ILSVRC2012_test_00086325.google.jpg
Amazon:https://obj-manip.cs.princeton.edu/results/test/ILSVRC2012_test_00086325.amazon.jpg
Google:https://obj-manip.cs.princeton.edu/results/test/ILSVRC2012_test_00009871.google.jpg
Amazon:https://obj-manip.cs.princeton.edu/results/test/ILSVRC2012_test_00009871.amazon.jpg
虽然我了解人脸检测器并不完美,并且会犯下难以解释的错误,但这里过高的错误否定率使我怀疑是否存在某些错误。也许降低人脸检测器的阈值会产生更多被检测到的人脸,但我看不到如何在Google's documentation中执行此操作。
这是我使用的代码
from google.cloud import vision
from google.protobuf.json_format import MessageToJson
import json
# src: the filename of the input image
# dst: the filename to store the detection results
# return value: the number of detected faces
# side effect: store the face detection results in dst
def detect(self, src, dst):
img = vision.types.Image(content=open(src, 'rb').read())
response = json.loads(MessageToJson(self.client.face_detection(image=img)))
json.dump(response, open(dst, 'wt'))
if response == {}:
return 0
else:
return len(response['faceAnnotations'])
关于让Google如何获取更多面孔的想法?谢谢!
这很有趣。您是否尝试过其他人脸检测器,例如Amazone Rekognition,Xailient FaceSDK或Microsoft FaceAPI,看看它们是否比Google Cloud Vision人脸检测API更好?
这里是您可能感兴趣的帖子:https://www.xailient.com/post/integrate-face-detection-in-your-app