Amazon.Rekognition.AmazonRekognitionClient.CompareFaces C# (CSharp) Method

CompareFaces() public method

Compares a face in the source input image with each face detected in the target input image.

If the source image contains multiple faces, the service detects the largest face and uses it to compare with each face detected in the target image.

In response, the operation returns an array of face matches ordered by similarity score with the highest similarity scores first. For each face match, the response provides a bounding box of the face and confidence value (indicating the level of confidence that the bounding box contains a face). The response also provides a similarity score, which indicates how closely the faces match.

By default, only faces with the similarity score of greater than or equal to 80% are returned in the response. You can change this value.

In addition to the face matches, the response returns information about the face in the source image, including the bounding box of the face and confidence value.

This is a stateless API operation. That is, the operation does not persist any data.

For an example, see get-started-exercise-compare-faces

This operation requires permissions to perform the rekognition:CompareFaces action.

/// You are not authorized to perform the action. /// /// The input image size exceeds the allowed limit. For more information, see limits. /// /// Amazon Rekognition experienced a service issue. Try your call again. /// /// The provided image format is not supported. /// /// Input parameter violated a constraint. Validate your parameter before calling the /// API again. /// /// Amazon Rekognition is unable to access the S3 object specified in the request. /// /// The number of requests exceeded your throughput limit. If you want to increase this /// limit, contact Amazon Rekognition. /// /// Amazon Rekognition is temporarily unable to process the request. Try your call again. ///
public CompareFaces ( CompareFacesRequest request ) : CompareFacesResponse
request Amazon.Rekognition.Model.CompareFacesRequest Container for the necessary parameters to execute the CompareFaces service method.
return Amazon.Rekognition.Model.CompareFacesResponse
        public CompareFacesResponse CompareFaces(CompareFacesRequest request)
        {
            var marshaller = new CompareFacesRequestMarshaller();
            var unmarshaller = CompareFacesResponseUnmarshaller.Instance;

            return Invoke<CompareFacesRequest,CompareFacesResponse>(request, marshaller, unmarshaller);
        }