Example usage for com.amazonaws.services.rekognition.model CompareFacesResult getFaceMatches

List of usage examples for com.amazonaws.services.rekognition.model CompareFacesResult getFaceMatches

Introduction

In this page you can find the example usage for com.amazonaws.services.rekognition.model CompareFacesResult getFaceMatches.

Prototype


public java.util.List<CompareFacesMatch> getFaceMatches() 

Source Link

Document

An array of faces in the target image that match the source image face.

Usage

From source file:mx.iteso.desi.cloud.hw3.AWSFaceCompare.java

License:Apache License

private Face compare(String sourceKey, String targetKey) {
    Image source = getImageUtil(sourceKey);
    Image target = getImageUtil(targetKey);
    CompareFacesResult compareFacesResult = callCompareFaces(source, target,
            AWSFaceCompare.SIMILARITY_THRESHOLD);

    if (compareFacesResult.getFaceMatches().size() > 0) {
        return new Face(targetKey, compareFacesResult.getFaceMatches().get(0).getSimilarity());
    } else {//from   ww  w  .  j av a2s  . com
        return new Face("", 0.0f);
    }
}