public class CompareFacesRequest extends AmazonWebServiceRequest implements Serializable
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.
Constructor and Description |
---|
CompareFacesRequest()
Default constructor for CompareFacesRequest object.
|
CompareFacesRequest(Image sourceImage,
Image targetImage)
Constructs a new CompareFacesRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Float |
getSimilarityThreshold()
The minimum level of confidence in the match you want included in the
result.
|
Image |
getSourceImage()
Source image either as bytes or an S3 object
|
Image |
getTargetImage()
Target image either as bytes or an S3 object
|
int |
hashCode() |
void |
setSimilarityThreshold(Float similarityThreshold)
The minimum level of confidence in the match you want included in the
result.
|
void |
setSourceImage(Image sourceImage)
Source image either as bytes or an S3 object
|
void |
setTargetImage(Image targetImage)
Target image either as bytes or an S3 object
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
CompareFacesRequest |
withSimilarityThreshold(Float similarityThreshold)
The minimum level of confidence in the match you want included in the
result.
|
CompareFacesRequest |
withSourceImage(Image sourceImage)
Source image either as bytes or an S3 object
|
CompareFacesRequest |
withTargetImage(Image targetImage)
Target image either as bytes or an S3 object
|
clone, copyBaseTo, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public CompareFacesRequest()
public CompareFacesRequest(Image sourceImage, Image targetImage)
sourceImage
- Source image either as bytes or an S3 object
targetImage
- Target image either as bytes or an S3 object
public Image getSourceImage()
Source image either as bytes or an S3 object
Source image either as bytes or an S3 object
public void setSourceImage(Image sourceImage)
Source image either as bytes or an S3 object
sourceImage
- Source image either as bytes or an S3 object
public CompareFacesRequest withSourceImage(Image sourceImage)
Source image either as bytes or an S3 object
Returns a reference to this object so that method calls can be chained together.
sourceImage
- Source image either as bytes or an S3 object
public Image getTargetImage()
Target image either as bytes or an S3 object
Target image either as bytes or an S3 object
public void setTargetImage(Image targetImage)
Target image either as bytes or an S3 object
targetImage
- Target image either as bytes or an S3 object
public CompareFacesRequest withTargetImage(Image targetImage)
Target image either as bytes or an S3 object
Returns a reference to this object so that method calls can be chained together.
targetImage
- Target image either as bytes or an S3 object
public Float getSimilarityThreshold()
The minimum level of confidence in the match you want included in the result.
Constraints:
Length: 0 - 100
The minimum level of confidence in the match you want included in the result.
public void setSimilarityThreshold(Float similarityThreshold)
The minimum level of confidence in the match you want included in the result.
Constraints:
Length: 0 - 100
similarityThreshold
- The minimum level of confidence in the match you want included in the result.
public CompareFacesRequest withSimilarityThreshold(Float similarityThreshold)
The minimum level of confidence in the match you want included in the result.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 0 - 100
similarityThreshold
- The minimum level of confidence in the match you want included in the result.
public String toString()
toString
in class Object
Object.toString()
Copyright © 2017. All rights reserved.