search_faces
async
¶
search_faces(
collection_id: CollectionId,
face_id: FaceId,
*,
config_overrides: Optional[AsyncRekognitionClientConfig] = 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.
>>> await 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/async_rekognition.py
4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 | |