search_faces
¶
search_faces(
collection_id: CollectionId,
face_id: FaceId,
*,
config_overrides: Optional[RekognitionClientConfig] = None,
max_faces: Optional[MaxFaces] = None,
face_match_threshold: Optional[Percent] = None,
) -> SearchFacesResponse
For a given input face ID, searches for matching faces in the collection the face belongs to. You get a face ID when you add a face to the collection using the IndexFaces operation. The operation compares the features of the input face with faces in the specified collection.
You can also search faces without indexing faces by using the SearchFacesByImage operation.
The operation response returns an array of faces that match, ordered by similarity score with the highest similarity first. More specifically, it is an array of metadata for each face match that is found. Along with the metadata, the response also includes a confidence value for each face match, indicating the confidence that the specific face matches the input face.
For an example, see Searching for a face using its face ID in the Amazon Rekognition Developer Guide.
This operation requires permissions to perform the rekognition:SearchFaces action.
Parameters:
-
collection_id(CollectionId) –ID of the collection the face belongs to.
-
face_id(FaceId) –ID of a face to find matches for in the collection.
-
max_faces(Optional[MaxFaces], default:None) –Maximum number of faces to return. The operation returns the maximum number of faces with the highest confidence in the match.
-
face_match_threshold(Optional[Percent], default:None) –Optional value specifying the minimum confidence in the face match to return. For example, don't return any matches where confidence in matches is less than 70%. The default value is 80%.
Raises:
-
AccessDeniedException–You are not authorized to perform the action.
-
InternalServerError–Amazon Rekognition experienced a service issue. Try your call again.
-
InvalidParameterException–Input parameter violated a constraint. Validate your parameter before calling the API operation again.
-
ProvisionedThroughputExceededException–The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.
-
ResourceNotFoundException–The resource specified in the request cannot be found.
-
ThrottlingException–Amazon Rekognition is temporarily unable to process the request. Try your call again.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To delete a face This operation searches for matching faces in the collection the supplied face belongs to.
>>> client.search_faces(collection_id='myphotos', face_id='70008e50-75e4-55d0-8e80-363fb73b3a14', max_faces=10, face_match_threshold=90)
Source code in docs_src/capo_rekognition/_services/rekognition.py
4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 | |