From 106a7299c6900ee207572047ec490b2649e802b5 Mon Sep 17 00:00:00 2001 From: AWS Mobile SDK Bot <46607340+awsmobilesdk@users.noreply.github.com> Date: Tue, 9 May 2023 13:53:39 -0400 Subject: [PATCH] feat(aws-android-sdk-rekognition): update models to latest (#3279) --- .../rekognition/AmazonRekognition.java | 21 +- .../rekognition/AmazonRekognitionClient.java | 21 +- .../services/rekognition/model/Attribute.java | 24 +- ...ateFaceLivenessSessionRequestSettings.java | 20 +- .../rekognition/model/DetectFacesRequest.java | 175 ++++++------ .../rekognition/model/FaceDetail.java | 108 +++++++- .../rekognition/model/FaceOccluded.java | 260 ++++++++++++++++++ .../rekognition/model/IndexFacesRequest.java | 172 ++++++------ .../transform/FaceDetailJsonMarshaller.java | 5 + .../transform/FaceDetailJsonUnmarshaller.java | 3 + .../transform/FaceOccludedJsonMarshaller.java | 49 ++++ .../FaceOccludedJsonUnmarshaller.java | 59 ++++ 12 files changed, 728 insertions(+), 189 deletions(-) create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceOccluded.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonMarshaller.java create mode 100644 aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonUnmarshaller.java diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java index a7c3df8e30..9fc3218cef 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java @@ -1539,8 +1539,8 @@ DetectCustomLabelsResult detectCustomLabels(DetectCustomLabelsRequest detectCust * 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. + * landmarks (for example, coordinates of eye and mouth), pose, presence of + * facial occlusion, and so on. *

*

* The face-detection algorithm is most effective on frontal faces. For @@ -2889,13 +2889,16 @@ GetTextDetectionResult getTextDetection(GetTextDetectionRequest getTextDetection * * *

- * If you request all facial attributes (by using the - * detectionAttributes parameter), Amazon Rekognition returns - * detailed facial attributes, such as facial landmarks (for example, - * location of eye and mouth) and other facial attributes. If you provide - * the same image, specify the same collection, and use the same external ID - * in the IndexFaces operation, Amazon Rekognition doesn't save - * duplicate face metadata. + * If you request ALL or specific facial attributes (e.g., + * FACE_OCCLUDED) by using the detectionAttributes parameter, + * Amazon Rekognition returns detailed facial attributes, such as facial + * landmarks (for example, location of eye and mouth), facial occlusion, and + * other facial attributes. + *

+ *

+ * If you provide the same image, specify the same collection, and use the + * same external ID in the IndexFaces operation, Amazon + * Rekognition doesn't save duplicate face metadata. *

*

*

diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java index d08dd2e3aa..3d1d424e79 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java @@ -2378,8 +2378,8 @@ public DetectCustomLabelsResult detectCustomLabels( * 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. + * landmarks (for example, coordinates of eye and mouth), pose, presence of + * facial occlusion, and so on. *

*

* The face-detection algorithm is most effective on frontal faces. For @@ -4155,13 +4155,16 @@ public GetTextDetectionResult getTextDetection(GetTextDetectionRequest getTextDe * * *

- * If you request all facial attributes (by using the - * detectionAttributes parameter), Amazon Rekognition returns - * detailed facial attributes, such as facial landmarks (for example, - * location of eye and mouth) and other facial attributes. If you provide - * the same image, specify the same collection, and use the same external ID - * in the IndexFaces operation, Amazon Rekognition doesn't save - * duplicate face metadata. + * If you request ALL or specific facial attributes (e.g., + * FACE_OCCLUDED) by using the detectionAttributes parameter, + * Amazon Rekognition returns detailed facial attributes, such as facial + * landmarks (for example, location of eye and mouth), facial occlusion, and + * other facial attributes. + *

+ *

+ * If you provide the same image, specify the same collection, and use the + * same external ID in the IndexFaces operation, Amazon + * Rekognition doesn't save duplicate face metadata. *

*

*

diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Attribute.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Attribute.java index c9eb5e035a..8fbe5ca597 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Attribute.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Attribute.java @@ -24,7 +24,18 @@ public enum Attribute { DEFAULT("DEFAULT"), - ALL("ALL"); + ALL("ALL"), + AGE_RANGE("AGE_RANGE"), + BEARD("BEARD"), + EMOTIONS("EMOTIONS"), + EYEGLASSES("EYEGLASSES"), + EYES_OPEN("EYES_OPEN"), + GENDER("GENDER"), + MOUTH_OPEN("MOUTH_OPEN"), + MUSTACHE("MUSTACHE"), + FACE_OCCLUDED("FACE_OCCLUDED"), + SMILE("SMILE"), + SUNGLASSES("SUNGLASSES"); private String value; @@ -42,6 +53,17 @@ public String toString() { enumMap = new HashMap(); enumMap.put("DEFAULT", DEFAULT); enumMap.put("ALL", ALL); + enumMap.put("AGE_RANGE", AGE_RANGE); + enumMap.put("BEARD", BEARD); + enumMap.put("EMOTIONS", EMOTIONS); + enumMap.put("EYEGLASSES", EYEGLASSES); + enumMap.put("EYES_OPEN", EYES_OPEN); + enumMap.put("GENDER", GENDER); + enumMap.put("MOUTH_OPEN", MOUTH_OPEN); + enumMap.put("MUSTACHE", MUSTACHE); + enumMap.put("FACE_OCCLUDED", FACE_OCCLUDED); + enumMap.put("SMILE", SMILE); + enumMap.put("SUNGLASSES", SUNGLASSES); } /** diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateFaceLivenessSessionRequestSettings.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateFaceLivenessSessionRequestSettings.java index 71297f8077..7d8467fee5 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateFaceLivenessSessionRequestSettings.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateFaceLivenessSessionRequestSettings.java @@ -30,7 +30,8 @@ public class CreateFaceLivenessSessionRequestSettings implements Serializable { * audit images will be stored. Note that the Amazon S3 bucket must be * located in the caller's AWS account and in the same region as the Face * Liveness end-point. Additionally, the Amazon S3 object keys are - * auto-generated by the Face Liveness system. + * auto-generated by the Face Liveness system. Requires that the caller has + * the s3:PutObject permission on the Amazon S3 bucket. *

*/ private LivenessOutputConfig outputConfig; @@ -54,7 +55,8 @@ public class CreateFaceLivenessSessionRequestSettings implements Serializable { * audit images will be stored. Note that the Amazon S3 bucket must be * located in the caller's AWS account and in the same region as the Face * Liveness end-point. Additionally, the Amazon S3 object keys are - * auto-generated by the Face Liveness system. + * auto-generated by the Face Liveness system. Requires that the caller has + * the s3:PutObject permission on the Amazon S3 bucket. *

* * @return

@@ -63,6 +65,8 @@ public class CreateFaceLivenessSessionRequestSettings implements Serializable { * must be located in the caller's AWS account and in the same * region as the Face Liveness end-point. Additionally, the Amazon * S3 object keys are auto-generated by the Face Liveness system. + * Requires that the caller has the s3:PutObject + * permission on the Amazon S3 bucket. *

*/ public LivenessOutputConfig getOutputConfig() { @@ -75,7 +79,8 @@ public LivenessOutputConfig getOutputConfig() { * audit images will be stored. Note that the Amazon S3 bucket must be * located in the caller's AWS account and in the same region as the Face * Liveness end-point. Additionally, the Amazon S3 object keys are - * auto-generated by the Face Liveness system. + * auto-generated by the Face Liveness system. Requires that the caller has + * the s3:PutObject permission on the Amazon S3 bucket. *

* * @param outputConfig

@@ -84,7 +89,8 @@ public LivenessOutputConfig getOutputConfig() { * Amazon S3 bucket must be located in the caller's AWS account * and in the same region as the Face Liveness end-point. * Additionally, the Amazon S3 object keys are auto-generated by - * the Face Liveness system. + * the Face Liveness system. Requires that the caller has the + * s3:PutObject permission on the Amazon S3 bucket. *

*/ public void setOutputConfig(LivenessOutputConfig outputConfig) { @@ -97,7 +103,8 @@ public void setOutputConfig(LivenessOutputConfig outputConfig) { * audit images will be stored. Note that the Amazon S3 bucket must be * located in the caller's AWS account and in the same region as the Face * Liveness end-point. Additionally, the Amazon S3 object keys are - * auto-generated by the Face Liveness system. + * auto-generated by the Face Liveness system. Requires that the caller has + * the s3:PutObject permission on the Amazon S3 bucket. *

*

* Returns a reference to this object so that method calls can be chained @@ -109,7 +116,8 @@ public void setOutputConfig(LivenessOutputConfig outputConfig) { * Amazon S3 bucket must be located in the caller's AWS account * and in the same region as the Face Liveness end-point. * Additionally, the Amazon S3 object keys are auto-generated by - * the Face Liveness system. + * the Face Liveness system. Requires that the caller has the + * s3:PutObject permission on the Amazon S3 bucket. *

* @return A reference to this updated object so that method calls can be * chained together. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DetectFacesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DetectFacesRequest.java index ce22f18aea..f636ca0409 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DetectFacesRequest.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DetectFacesRequest.java @@ -28,7 +28,7 @@ * 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. + * coordinates of eye and mouth), pose, presence of facial occlusion, and so on. *

*

* The face-detection algorithm is most effective on frontal faces. For @@ -70,18 +70,19 @@ public class DetectFacesRequest extends AmazonWebServiceRequest implements Seria /** *

- * 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a - * logical AND operator to determine which attributes to return (in this + * logical "AND" operator to determine which attributes to return (in this * case, all attributes). *

*/ @@ -211,35 +212,37 @@ public DetectFacesRequest withImage(Image image) { /** *

- * 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a - * logical AND operator to determine which attributes to return (in this + * logical "AND" operator to determine which attributes to return (in this * case, all attributes). *

* * @return

- * 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, + * Pose, Quality, and + * Landmarks - will always be returned. You can request + * for specific facial attributes (in addition to the default list) + * - by using ["DEFAULT", "FACE_OCCLUDED"] or just [ + * "FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service - * uses a logical AND operator to determine which attributes to + * uses a logical "AND" operator to determine which attributes to * return (in this case, all attributes). *

*/ @@ -249,36 +252,38 @@ public java.util.List 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a - * logical AND operator to determine which attributes to return (in this + * logical "AND" operator to determine which attributes to return (in this * case, all attributes). *

* * @param 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using [ + * "DEFAULT", "FACE_OCCLUDED"] or just [ + * "FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the - * service uses a logical AND operator to determine which + * service uses a logical "AND" operator to determine which * attributes to return (in this case, all attributes). *

*/ @@ -293,18 +298,19 @@ public void setAttributes(java.util.Collection 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a - * logical AND operator to determine which attributes to return (in this + * logical "AND" operator to determine which attributes to return (in this * case, all attributes). *

*

@@ -312,20 +318,21 @@ public void setAttributes(java.util.Collection attributes) { * together. * * @param 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using [ + * "DEFAULT", "FACE_OCCLUDED"] or just [ + * "FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the - * service uses a logical AND operator to determine which + * service uses a logical "AND" operator to determine which * attributes to return (in this case, all attributes). *

* @return A reference to this updated object so that method calls can be @@ -343,18 +350,19 @@ public DetectFacesRequest withAttributes(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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a - * logical AND operator to determine which attributes to return (in this + * logical "AND" operator to determine which attributes to return (in this * case, all attributes). *

*

@@ -362,20 +370,21 @@ public DetectFacesRequest withAttributes(String... attributes) { * together. * * @param 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using [ + * "DEFAULT", "FACE_OCCLUDED"] or just [ + * "FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the - * service uses a logical AND operator to determine which + * service uses a logical "AND" operator to determine which * attributes to return (in this case, all attributes). *

* @return A reference to this updated object so that method calls can be diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceDetail.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceDetail.java index ee464acd65..39f1083d5c 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceDetail.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceDetail.java @@ -185,6 +185,19 @@ public class FaceDetail implements Serializable { */ private Float confidence; + /** + *

+ * FaceOccluded should return "true" with a high confidence + * score if a detected face’s eyes, nose, and mouth are partially captured + * or if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. FaceOccluded should return "false" with a + * high confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ */ + private FaceOccluded faceOccluded; + /** *

* Bounding box of the face. Default attribute. @@ -1037,6 +1050,90 @@ public FaceDetail withConfidence(Float confidence) { return this; } + /** + *

+ * FaceOccluded should return "true" with a high confidence + * score if a detected face’s eyes, nose, and mouth are partially captured + * or if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. FaceOccluded should return "false" with a + * high confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * + * @return

+ * FaceOccluded should return "true" with a high + * confidence score if a detected face’s eyes, nose, and mouth are + * partially captured or if they are covered by masks, dark + * sunglasses, cell phones, hands, or other objects. + * FaceOccluded should return "false" with a high + * confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ */ + public FaceOccluded getFaceOccluded() { + return faceOccluded; + } + + /** + *

+ * FaceOccluded should return "true" with a high confidence + * score if a detected face’s eyes, nose, and mouth are partially captured + * or if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. FaceOccluded should return "false" with a + * high confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * + * @param faceOccluded

+ * FaceOccluded should return "true" with a high + * confidence score if a detected face’s eyes, nose, and mouth + * are partially captured or if they are covered by masks, dark + * sunglasses, cell phones, hands, or other objects. + * FaceOccluded should return "false" with a high + * confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ */ + public void setFaceOccluded(FaceOccluded faceOccluded) { + this.faceOccluded = faceOccluded; + } + + /** + *

+ * FaceOccluded should return "true" with a high confidence + * score if a detected face’s eyes, nose, and mouth are partially captured + * or if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. FaceOccluded should return "false" with a + * high confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceOccluded

+ * FaceOccluded should return "true" with a high + * confidence score if a detected face’s eyes, nose, and mouth + * are partially captured or if they are covered by masks, dark + * sunglasses, cell phones, hands, or other objects. + * FaceOccluded should return "false" with a high + * confidence score if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public FaceDetail withFaceOccluded(FaceOccluded faceOccluded) { + this.faceOccluded = faceOccluded; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -1077,7 +1174,9 @@ public String toString() { if (getQuality() != null) sb.append("Quality: " + getQuality() + ","); if (getConfidence() != null) - sb.append("Confidence: " + getConfidence()); + sb.append("Confidence: " + getConfidence() + ","); + if (getFaceOccluded() != null) + sb.append("FaceOccluded: " + getFaceOccluded()); sb.append("}"); return sb.toString(); } @@ -1103,6 +1202,8 @@ public int hashCode() { hashCode = prime * hashCode + ((getPose() == null) ? 0 : getPose().hashCode()); hashCode = prime * hashCode + ((getQuality() == null) ? 0 : getQuality().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); + hashCode = prime * hashCode + + ((getFaceOccluded() == null) ? 0 : getFaceOccluded().hashCode()); return hashCode; } @@ -1183,6 +1284,11 @@ public boolean equals(Object obj) { if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; + if (other.getFaceOccluded() == null ^ this.getFaceOccluded() == null) + return false; + if (other.getFaceOccluded() != null + && other.getFaceOccluded().equals(this.getFaceOccluded()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceOccluded.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceOccluded.java new file mode 100644 index 0000000000..2c91db3ebc --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/FaceOccluded.java @@ -0,0 +1,260 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.rekognition.model; + +import java.io.Serializable; + +/** + *

+ * FaceOccluded should return "true" with a high confidence score + * if a detected face’s eyes, nose, and mouth are partially captured or if they + * are covered by masks, dark sunglasses, cell phones, hands, or other objects. + * FaceOccluded should return "false" with a high confidence score + * if common occurrences that do not impact face verification are detected, such + * as eye glasses, lightly tinted sunglasses, strands of hair, and others. + *

+ *

+ * You can use FaceOccluded to determine if an obstruction on a + * face negatively impacts using the image for face matching. + *

+ */ +public class FaceOccluded implements Serializable { + /** + *

+ * True if a detected face’s eyes, nose, and mouth are partially captured or + * if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. False if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ */ + private Boolean value; + + /** + *

+ * The confidence that the service has detected the presence of a face + * occlusion. + *

+ *

+ * Constraints:
+ * Length: 0.0 - 100.0
+ */ + private Float confidence; + + /** + *

+ * True if a detected face’s eyes, nose, and mouth are partially captured or + * if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. False if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * + * @return

+ * True if a detected face’s eyes, nose, and mouth are partially + * captured or if they are covered by masks, dark sunglasses, cell + * phones, hands, or other objects. False if common occurrences that + * do not impact face verification are detected, such as eye + * glasses, lightly tinted sunglasses, strands of hair, and others. + *

+ */ + public Boolean isValue() { + return value; + } + + /** + *

+ * True if a detected face’s eyes, nose, and mouth are partially captured or + * if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. False if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * + * @return

+ * True if a detected face’s eyes, nose, and mouth are partially + * captured or if they are covered by masks, dark sunglasses, cell + * phones, hands, or other objects. False if common occurrences that + * do not impact face verification are detected, such as eye + * glasses, lightly tinted sunglasses, strands of hair, and others. + *

+ */ + public Boolean getValue() { + return value; + } + + /** + *

+ * True if a detected face’s eyes, nose, and mouth are partially captured or + * if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. False if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ * + * @param value

+ * True if a detected face’s eyes, nose, and mouth are partially + * captured or if they are covered by masks, dark sunglasses, + * cell phones, hands, or other objects. False if common + * occurrences that do not impact face verification are detected, + * such as eye glasses, lightly tinted sunglasses, strands of + * hair, and others. + *

+ */ + public void setValue(Boolean value) { + this.value = value; + } + + /** + *

+ * True if a detected face’s eyes, nose, and mouth are partially captured or + * if they are covered by masks, dark sunglasses, cell phones, hands, or + * other objects. False if common occurrences that do not impact face + * verification are detected, such as eye glasses, lightly tinted + * sunglasses, strands of hair, and others. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + * + * @param value

+ * True if a detected face’s eyes, nose, and mouth are partially + * captured or if they are covered by masks, dark sunglasses, + * cell phones, hands, or other objects. False if common + * occurrences that do not impact face verification are detected, + * such as eye glasses, lightly tinted sunglasses, strands of + * hair, and others. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public FaceOccluded withValue(Boolean value) { + this.value = value; + return this; + } + + /** + *

+ * The confidence that the service has detected the presence of a face + * occlusion. + *

+ *

+ * Constraints:
+ * Length: 0.0 - 100.0
+ * + * @return

+ * The confidence that the service has detected the presence of a + * face occlusion. + *

+ */ + public Float getConfidence() { + return confidence; + } + + /** + *

+ * The confidence that the service has detected the presence of a face + * occlusion. + *

+ *

+ * Constraints:
+ * Length: 0.0 - 100.0
+ * + * @param confidence

+ * The confidence that the service has detected the presence of a + * face occlusion. + *

+ */ + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + /** + *

+ * The confidence that the service has detected the presence of a face + * occlusion. + *

+ *

+ * Returns a reference to this object so that method calls can be chained + * together. + *

+ * Constraints:
+ * Length: 0.0 - 100.0
+ * + * @param confidence

+ * The confidence that the service has detected the presence of a + * face occlusion. + *

+ * @return A reference to this updated object so that method calls can be + * chained together. + */ + public FaceOccluded withConfidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getValue() != null) + sb.append("Value: " + getValue() + ","); + if (getConfidence() != null) + sb.append("Confidence: " + getConfidence()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode()); + hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof FaceOccluded == false) + return false; + FaceOccluded other = (FaceOccluded) obj; + + if (other.getValue() == null ^ this.getValue() == null) + return false; + if (other.getValue() != null && other.getValue().equals(this.getValue()) == false) + return false; + if (other.getConfidence() == null ^ this.getConfidence() == null) + return false; + if (other.getConfidence() != null + && other.getConfidence().equals(this.getConfidence()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesRequest.java index 67bd3bd0e5..42f83bd4b9 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesRequest.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/IndexFacesRequest.java @@ -156,13 +156,16 @@ * * *

- * If you request all facial attributes (by using the - * detectionAttributes parameter), Amazon Rekognition returns - * detailed facial attributes, such as facial landmarks (for example, location - * of eye and mouth) and other facial attributes. If you provide the same image, - * specify the same collection, and use the same external ID in the - * IndexFaces operation, Amazon Rekognition doesn't save duplicate - * face metadata. + * If you request ALL or specific facial attributes (e.g., + * FACE_OCCLUDED) by using the detectionAttributes parameter, + * Amazon Rekognition returns detailed facial attributes, such as facial + * landmarks (for example, location of eye and mouth), facial occlusion, and + * other facial attributes. + *

+ *

+ * If you provide the same image, specify the same collection, and use the same + * external ID in the IndexFaces operation, Amazon Rekognition + * doesn't save duplicate face metadata. *

*

*

@@ -217,14 +220,15 @@ public class IndexFacesRequest extends AmazonWebServiceRequest implements Serial /** *

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a @@ -538,14 +542,15 @@ public IndexFacesRequest withExternalImageId(String externalImageId) { /** *

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a @@ -554,15 +559,16 @@ public IndexFacesRequest withExternalImageId(String externalImageId) { *

* * @return

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, + * Pose, Quality, and + * Landmarks - will always be returned. You can request + * for specific facial attributes (in addition to the default list) + * - by using ["DEFAULT", "FACE_OCCLUDED"] or just + * ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service @@ -576,14 +582,15 @@ public java.util.List getDetectionAttributes() { /** *

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a @@ -592,16 +599,17 @@ public java.util.List getDetectionAttributes() { *

* * @param detectionAttributes

- * An array of facial attributes that 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using + * ["DEFAULT", "FACE_OCCLUDED"] or just + * ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the @@ -620,14 +628,15 @@ public void setDetectionAttributes(java.util.Collection detectionAttribu /** *

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a @@ -639,16 +648,17 @@ public void setDetectionAttributes(java.util.Collection detectionAttribu * together. * * @param detectionAttributes

- * An array of facial attributes that 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using + * ["DEFAULT", "FACE_OCCLUDED"] or just + * ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the @@ -670,14 +680,15 @@ public IndexFacesRequest withDetectionAttributes(String... detectionAttributes) /** *

- * An array of facial attributes that 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. + * An array of facial attributes you want to be returned. A + * DEFAULT subset of facial attributes - + * BoundingBox, Confidence, Pose, + * Quality, and Landmarks - will always be + * returned. You can request for specific facial attributes (in addition to + * the default list) - by using ["DEFAULT", "FACE_OCCLUDED"] or + * just ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more attributes may + * increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the service uses a @@ -689,16 +700,17 @@ public IndexFacesRequest withDetectionAttributes(String... detectionAttributes) * together. * * @param detectionAttributes

- * An array of facial attributes that 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: + * An array of facial attributes you want to be returned. A + * DEFAULT 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. + * Landmarks - will always be returned. You can + * request for specific facial attributes (in addition to the + * default list) - by using + * ["DEFAULT", "FACE_OCCLUDED"] or just + * ["FACE_OCCLUDED"]. You can request for all facial + * attributes by using ["ALL"]. Requesting more + * attributes may increase response time. *

*

* If you provide both, ["ALL", "DEFAULT"], the diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonMarshaller.java index f98a134ce5..ae2db2d6aa 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonMarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonMarshaller.java @@ -113,6 +113,11 @@ public void marshall(FaceDetail faceDetail, AwsJsonWriter jsonWriter) throws Exc jsonWriter.name("Confidence"); jsonWriter.value(confidence); } + if (faceDetail.getFaceOccluded() != null) { + FaceOccluded faceOccluded = faceDetail.getFaceOccluded(); + jsonWriter.name("FaceOccluded"); + FaceOccludedJsonMarshaller.getInstance().marshall(faceOccluded, jsonWriter); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonUnmarshaller.java index 5a7621d5f1..67a010803e 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonUnmarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceDetailJsonUnmarshaller.java @@ -84,6 +84,9 @@ public FaceDetail unmarshall(JsonUnmarshallerContext context) throws Exception { } else if (name.equals("Confidence")) { faceDetail.setConfidence(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("FaceOccluded")) { + faceDetail.setFaceOccluded(FaceOccludedJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonMarshaller.java new file mode 100644 index 0000000000..5ed12af5ff --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonMarshaller.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO FaceOccluded + */ +class FaceOccludedJsonMarshaller { + + public void marshall(FaceOccluded faceOccluded, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (faceOccluded.getValue() != null) { + Boolean value = faceOccluded.getValue(); + jsonWriter.name("Value"); + jsonWriter.value(value); + } + if (faceOccluded.getConfidence() != null) { + Float confidence = faceOccluded.getConfidence(); + jsonWriter.name("Confidence"); + jsonWriter.value(confidence); + } + jsonWriter.endObject(); + } + + private static FaceOccludedJsonMarshaller instance; + + public static FaceOccludedJsonMarshaller getInstance() { + if (instance == null) + instance = new FaceOccludedJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonUnmarshaller.java new file mode 100644 index 0000000000..6ee3631d31 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceOccludedJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"). + * You may not use this file except in compliance with the License. + * A copy of the License is located at + * + * http://aws.amazon.com/apache2.0 + * + * or in the "license" file accompanying this file. This file is distributed + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + * express or implied. See the License for the specific language governing + * permissions and limitations under the License. + */ + +package com.amazonaws.services.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO FaceOccluded + */ +class FaceOccludedJsonUnmarshaller implements Unmarshaller { + + public FaceOccluded unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + FaceOccluded faceOccluded = new FaceOccluded(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Value")) { + faceOccluded.setValue(BooleanJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Confidence")) { + faceOccluded.setConfidence(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return faceOccluded; + } + + private static FaceOccludedJsonUnmarshaller instance; + + public static FaceOccludedJsonUnmarshaller getInstance() { + if (instance == null) + instance = new FaceOccludedJsonUnmarshaller(); + return instance; + } +}