This is the new code added to services/rekognition.cfc:
/**
* Returns an array of face matches ordered by similarity score in descending order
* https://docs.aws.amazon.com/rekognition/latest/dg/API_CompareFaces.html
* @SourceImage a struct with a "Bytes" key containing Base64-encoded binary data or an "S3Object" struct containing a "Bucket", "Key", and optional "Version" - https://docs.aws.amazon.com/rekognition/latest/dg/API_Image.html
* @TargetImage a struct with a "Bytes" key containing Base64-encoded binary data or an "S3Object" struct containing a "Bucket", "Key", and optional "Version" - https://docs.aws.amazon.com/rekognition/latest/dg/API_Image.html
* @SimilarityThreshold a numeric minimum level of confidence that a match must meet to be included. Valid Range: Minimum value of 0. Maximum value of 100.
* @QualityFilter a string filter that specifies a quality bar for how much filtering is done to identify faces. Valid Values: NONE | AUTO | LOW | MEDIUM | HIGH
*/
public any function compareFaces(
required struct SourceImage,
required struct TargetImage,
numeric SimilarityThreshold,
string QualityFilter
) {
var requestSettings = api.resolveRequestSettings( argumentCollection = arguments );
var args = {
'SourceImage': arguments.SourceImage,
'TargetImage': arguments.TargetImage
};
if ( !isNull( arguments.SimilarityThreshold ) ) args[ 'SimilarityThreshold' ] = arguments.SimilarityThreshold;
if ( !isNull( arguments.QualityFilter ) ) args[ 'QualityFilter' ] = arguments.QualityFilter;
return apiCall( requestSettings, 'CompareFaces', args);
}
Feature
This pull request adds support for CompareFaces resource in AWS Rekognition service (reference: https://docs.aws.amazon.com/rekognition/latest/dg/API_CompareFaces.html). It adds the
compareFaces
method to the rekognition.cfc service.New code
This is the new code added to services/rekognition.cfc:
Use example: