Я запускаю API распознавания лиц из Google и Amazon на 1000 тестовых изображений. В результатах 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 .
Это код, который я использовал
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 обнаруживать больше лиц? Спасибо!