Amazon Rekognition IndexFaces API Maximum number of faces you want to register at the time of action, It is possible to eliminate faces that are not clear but blurry.
With the default settings, blurred images and face images that are mixed in with the background are also subject to registration, which reduces accuracy. Traditionally, Index Faces indexes up to 15 faces in the input image. The new version of the face detection model indexes up to 100 faces in the input image.
MaxFaces You can set the maximum value of the face image you want to register As for the registered images, clear and clear images have the highest priority.
QualityFilter Filter to exclude poor quality images If you set the QualityFilter to automatic, Amazon will exclude poor quality images.
Controllable level to filter "** AUTO " if you want the filter to be automatic on the Amazon side Judgment sweet filter " LOW " Intermediate filter " MEDIUM " Strict filter " HIGH " If you do not want to filter, specify " N ONE **"
amareko_filter.py
import boto3
collection = "qrestia"
image_file = "TestImage.jpg "
external_image_id = "Qiita test ID"
def index_faces():
rekognition_client = boto3.client('rekognition')
with open(image_file, 'rb') as image:
rekognition_response = rekognition_client.index_faces(
Image={'Bytes': image.read()},
CollectionId=collection,
ExternalImageId=external_image_id,
QualityFilter="AUTO", #Set Quality Filter to "Automatic"
MaxFaces=3) #Increase the maximum number of face detection to 3
print(rekognition_response)
if __name__ == '__main__':
index_faces()
Information about faces found in the image but not indexed can be found in the array of UnindexedFace objects. From this response, you can understand the cause and make appropriate filter adjustments.
Recommended Posts