public class DetectFacesRequest extends AmazonWebServiceRequest implements java.io.Serializable
Detects faces within an image that is provided as input.
DetectFaces
detects the 100 largest faces in the image. For each
face detected, the operation returns face details. These details include a
bounding box of the face, a confidence value (that the bounding box contains
a face), and a fixed set of attributes such as facial landmarks (for example,
coordinates of eye and mouth), presence of beard, sunglasses, and so on.
The face-detection algorithm is most effective on frontal faces. For non-frontal or obscured faces, the algorithm might not detect the faces or might detect faces with lower confidence.
You pass the input image either as base64-encoded image bytes or as a reference to an image in an Amazon S3 bucket. If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes is not supported. The image must be either a PNG or JPEG formatted file.
This is a stateless API operation. That is, the operation does not persist any data.
This operation requires permissions to perform the
rekognition:DetectFaces
action.
Constructor and Description |
---|
DetectFacesRequest()
Default constructor for DetectFacesRequest object.
|
DetectFacesRequest(Image image)
Constructs a new DetectFacesRequest object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<java.lang.String> |
getAttributes()
An array of facial attributes you want to be returned.
|
Image |
getImage()
The input image as base64-encoded bytes or an S3 object.
|
int |
hashCode() |
void |
setAttributes(java.util.Collection<java.lang.String> attributes)
An array of facial attributes you want to be returned.
|
void |
setImage(Image image)
The input image as base64-encoded bytes or an S3 object.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
DetectFacesRequest |
withAttributes(java.util.Collection<java.lang.String> attributes)
An array of facial attributes you want to be returned.
|
DetectFacesRequest |
withAttributes(java.lang.String... attributes)
An array of facial attributes you want to be returned.
|
DetectFacesRequest |
withImage(Image image)
The input image as base64-encoded bytes or an S3 object.
|
clone, getCloneRoot, getCloneSource, getGeneralProgressListener, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public DetectFacesRequest()
public DetectFacesRequest(Image image)
image
- The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you
might not need to base64-encode image bytes passed using the
Bytes
field. For more information, see Images in
the Amazon Rekognition developer guide.
public Image getImage()
The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you might not
need to base64-encode image bytes passed using the Bytes
field. For more information, see Images in the Amazon Rekognition
developer guide.
The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you might
not need to base64-encode image bytes passed using the
Bytes
field. For more information, see Images in the
Amazon Rekognition developer guide.
public void setImage(Image image)
The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you might not
need to base64-encode image bytes passed using the Bytes
field. For more information, see Images in the Amazon Rekognition
developer guide.
image
- The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you
might not need to base64-encode image bytes passed using the
Bytes
field. For more information, see Images in
the Amazon Rekognition developer guide.
public DetectFacesRequest withImage(Image image)
The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you might not
need to base64-encode image bytes passed using the Bytes
field. For more information, see Images in the Amazon Rekognition
developer guide.
Returns a reference to this object so that method calls can be chained together.
image
- The input image as base64-encoded bytes or an S3 object. If you use the AWS CLI to call Amazon Rekognition operations, passing base64-encoded image bytes is not supported.
If you are using an AWS SDK to call Amazon Rekognition, you
might not need to base64-encode image bytes passed using the
Bytes
field. For more information, see Images in
the Amazon Rekognition developer guide.
public java.util.List<java.lang.String> getAttributes()
An array of facial attributes you want to be returned. This can be the
default list of attributes or all attributes. If you don't specify a
value for Attributes
or if you specify
["DEFAULT"]
, the API returns the following subset of facial
attributes: BoundingBox
, Confidence
,
Pose
, Quality
, and Landmarks
. If
you provide ["ALL"]
, all facial attributes are returned, but
the operation takes longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the service uses a
logical AND operator to determine which attributes to return (in this
case, all attributes).
An array of facial attributes you want to be returned. This can
be the default list of attributes or all attributes. If you don't
specify a value for Attributes
or if you specify
["DEFAULT"]
, the API returns the following subset of
facial attributes: BoundingBox
,
Confidence
, Pose
, Quality
,
and Landmarks
. If you provide ["ALL"]
,
all facial attributes are returned, but the operation takes
longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the service
uses a logical AND operator to determine which attributes to
return (in this case, all attributes).
public void setAttributes(java.util.Collection<java.lang.String> attributes)
An array of facial attributes you want to be returned. This can be the
default list of attributes or all attributes. If you don't specify a
value for Attributes
or if you specify
["DEFAULT"]
, the API returns the following subset of facial
attributes: BoundingBox
, Confidence
,
Pose
, Quality
, and Landmarks
. If
you provide ["ALL"]
, all facial attributes are returned, but
the operation takes longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the service uses a
logical AND operator to determine which attributes to return (in this
case, all attributes).
attributes
-
An array of facial attributes you want to be returned. This
can be the default list of attributes or all attributes. If
you don't specify a value for Attributes
or if
you specify ["DEFAULT"]
, the API returns the
following subset of facial attributes:
BoundingBox
, Confidence
,
Pose
, Quality
, and
Landmarks
. If you provide ["ALL"]
,
all facial attributes are returned, but the operation takes
longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the
service uses a logical AND operator to determine which
attributes to return (in this case, all attributes).
public DetectFacesRequest withAttributes(java.lang.String... attributes)
An array of facial attributes you want to be returned. This can be the
default list of attributes or all attributes. If you don't specify a
value for Attributes
or if you specify
["DEFAULT"]
, the API returns the following subset of facial
attributes: BoundingBox
, Confidence
,
Pose
, Quality
, and Landmarks
. If
you provide ["ALL"]
, all facial attributes are returned, but
the operation takes longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the service uses a
logical AND operator to determine which attributes to return (in this
case, all attributes).
Returns a reference to this object so that method calls can be chained together.
attributes
-
An array of facial attributes you want to be returned. This
can be the default list of attributes or all attributes. If
you don't specify a value for Attributes
or if
you specify ["DEFAULT"]
, the API returns the
following subset of facial attributes:
BoundingBox
, Confidence
,
Pose
, Quality
, and
Landmarks
. If you provide ["ALL"]
,
all facial attributes are returned, but the operation takes
longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the
service uses a logical AND operator to determine which
attributes to return (in this case, all attributes).
public DetectFacesRequest withAttributes(java.util.Collection<java.lang.String> attributes)
An array of facial attributes you want to be returned. This can be the
default list of attributes or all attributes. If you don't specify a
value for Attributes
or if you specify
["DEFAULT"]
, the API returns the following subset of facial
attributes: BoundingBox
, Confidence
,
Pose
, Quality
, and Landmarks
. If
you provide ["ALL"]
, all facial attributes are returned, but
the operation takes longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the service uses a
logical AND operator to determine which attributes to return (in this
case, all attributes).
Returns a reference to this object so that method calls can be chained together.
attributes
-
An array of facial attributes you want to be returned. This
can be the default list of attributes or all attributes. If
you don't specify a value for Attributes
or if
you specify ["DEFAULT"]
, the API returns the
following subset of facial attributes:
BoundingBox
, Confidence
,
Pose
, Quality
, and
Landmarks
. If you provide ["ALL"]
,
all facial attributes are returned, but the operation takes
longer to complete.
If you provide both, ["ALL", "DEFAULT"]
, the
service uses a logical AND operator to determine which
attributes to return (in this case, all attributes).
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.