Skip to content

aws.rekognition.search_users_by_image

Example SQL Queries

SELECT * FROM
aws.rekognition.search_users_by_image
WHERE
"collection_id" = 'VALUE'
AND "image" = 'VALUE';

Description

Searches for UserIDs using a supplied image. It first detects the largest face in the image, and then searches a specified collection for matching UserIDs.

The operation returns an array of UserIDs that match the face in the supplied image, ordered by similarity score with the highest similarity first. It also returns a bounding box for the face found in the input image.

Information about faces detected in the supplied image, but not used for the search, is returned in an array of UnsearchedFace objects. If no valid face is detected in the image, the response will contain an empty UserMatches list and no SearchedFace object.

Table Definition

Column NameColumn Data Type
collection_id Required Input Column

The ID of an existing collection containing the UserID.

VARCHAR
image Required Input Column

Provides the input image either as bytes or an S3 object.

You pass image bytes to an Amazon Rekognition API operation by using the Bytes property. For example, you would use the Bytes property to pass an image loaded from a local file system. Image bytes passed by using the Bytes property must be base64-encoded. Your code may not need to encode image bytes if you are using an AWS SDK to call Amazon Rekognition API operations.

For more information, see Analyzing an Image Loaded from a Local File System in the Amazon Rekognition Developer Guide.

You pass images stored in an S3 bucket to an Amazon Rekognition API operation by using the S3Object property. Images stored in an S3 bucket do not need to be base64-encoded.

The region for the S3 bucket containing the S3 object must match the region you use for Amazon Rekognition operations.

If you use the AWS CLI to call Amazon Rekognition operations, passing image bytes using the Bytes property is not supported. You must first upload the image to an Amazon S3 bucket and then call the operation using the S3Object property.

For Amazon Rekognition to process an S3 object, the user must have permission to access the S3 object. For more information, see How Amazon Rekognition works with IAM in the Amazon Rekognition Developer Guide.

STRUCT(
"bytes" BLOB,
"s3_object" STRUCT(
"bucket" VARCHAR,
"name" VARCHAR,
"version" VARCHAR
)
)
Show child fields
image.bytes

Blob of image bytes up to 5 MBs. Note that the maximum image size you can pass to DetectCustomLabels is 4MB.

image.s3_object

Identifies an S3 object as the image source.

Show child fields
image.s3_object.bucket

Name of the S3 bucket.

image.s3_object.name

S3 object key name.

image.s3_object.version

If the bucket is versioning enabled, you can specify the object version.

max_users Input Column

Maximum number of UserIDs to return.

BIGINT
quality_filter Input Column

A filter that specifies a quality bar for how much filtering is done to identify faces. Filtered faces aren't searched for in the collection. The default value is NONE.

VARCHAR
user_match_threshold Input Column

Specifies the minimum confidence in the UserID match to return. Default value is 80.

DOUBLE
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
face_model_version

Version number of the face detection model associated with the input collection CollectionId.

VARCHAR
searched_face

A list of FaceDetail objects containing the BoundingBox for the largest face in image, as well as the confidence in the bounding box, that was searched for matches. If no valid face is detected in the image the response will contain no SearchedFace object.

STRUCT(
"face_detail" STRUCT(
"bounding_box" STRUCT(
"width" DOUBLE,
"height" DOUBLE,
"left" DOUBLE,
"top" DOUBLE
),
"age_range" STRUCT(
"low" BIGINT,
"high" BIGINT
),
"smile" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eyeglasses" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"sunglasses" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"gender" STRUCT(
"value" VARCHAR,
"confidence" DOUBLE
),
"beard" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"mustache" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eyes_open" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"mouth_open" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"emotions" STRUCT(
"type" VARCHAR,
"confidence" DOUBLE
)[],
"landmarks" STRUCT(
"type" VARCHAR,
"x" DOUBLE,
"y" DOUBLE
)[],
"pose" STRUCT(
"roll" DOUBLE,
"yaw" DOUBLE,
"pitch" DOUBLE
),
"quality" STRUCT(
"brightness" DOUBLE,
"sharpness" DOUBLE
),
"confidence" DOUBLE,
"face_occluded" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eye_direction" STRUCT(
"yaw" DOUBLE,
"pitch" DOUBLE,
"confidence" DOUBLE
)
)
)
Show child fields
searched_face.face_detail

Structure containing attributes of the face that the algorithm detected.

A FaceDetail object contains either the default facial attributes or all facial attributes. The default attributes are BoundingBox, Confidence, Landmarks, Pose, and Quality.

GetFaceDetection is the only Amazon Rekognition Video stored video operation that can return a FaceDetail object with all attributes. To specify which attributes to return, use the FaceAttributes input parameter for StartFaceDetection. The following Amazon Rekognition Video operations return only the default attributes. The corresponding Start operations don't have a FaceAttributes input parameter:

  • GetCelebrityRecognition

  • GetPersonTracking

  • GetFaceSearch

The Amazon Rekognition Image DetectFaces and IndexFaces operations can return all facial attributes. To specify which attributes to return, use the Attributes input parameter for DetectFaces. For IndexFaces, use the DetectAttributes input parameter.

Show child fields
searched_face.face_detail.age_range

The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.

Show child fields
searched_face.face_detail.age_range.high

The highest estimated age.

searched_face.face_detail.age_range.low

The lowest estimated age.

searched_face.face_detail.beard

Indicates whether or not the face has a beard, and the confidence level in the determination.

Show child fields
searched_face.face_detail.beard.confidence

Level of confidence in the determination.

searched_face.face_detail.beard.value

Boolean value that indicates whether the face has beard or not.

searched_face.face_detail.bounding_box

Bounding box of the face. Default attribute.

Show child fields
searched_face.face_detail.bounding_box.height

Height of the bounding box as a ratio of the overall image height.

searched_face.face_detail.bounding_box.left

Left coordinate of the bounding box as a ratio of overall image width.

searched_face.face_detail.bounding_box.top

Top coordinate of the bounding box as a ratio of overall image height.

searched_face.face_detail.bounding_box.width

Width of the bounding box as a ratio of the overall image width.

searched_face.face_detail.confidence

Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.

searched_face.face_detail.emotions[]
Show child fields
searched_face.face_detail.emotions[].confidence

Level of confidence in the determination.

searched_face.face_detail.emotions[].type

Type of emotion detected.

searched_face.face_detail.eye_direction

Indicates the direction the eyes are gazing in, as defined by pitch and yaw.

Show child fields
searched_face.face_detail.eye_direction.confidence

The confidence that the service has in its predicted eye direction.

searched_face.face_detail.eye_direction.pitch

Value representing eye direction on the pitch axis.

searched_face.face_detail.eye_direction.yaw

Value representing eye direction on the yaw axis.

searched_face.face_detail.eyeglasses

Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.

Show child fields
searched_face.face_detail.eyeglasses.confidence

Level of confidence in the determination.

searched_face.face_detail.eyeglasses.value

Boolean value that indicates whether the face is wearing eye glasses or not.

searched_face.face_detail.eyes_open

Indicates whether or not the eyes on the face are open, and the confidence level in the determination.

Show child fields
searched_face.face_detail.eyes_open.confidence

Level of confidence in the determination.

searched_face.face_detail.eyes_open.value

Boolean value that indicates whether the eyes on the face are open.

searched_face.face_detail.face_occluded

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.

Show child fields
searched_face.face_detail.face_occluded.confidence

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

searched_face.face_detail.face_occluded.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.

searched_face.face_detail.gender

The predicted gender of a detected face.

Show child fields
searched_face.face_detail.gender.confidence

Level of confidence in the prediction.

searched_face.face_detail.gender.value

The predicted gender of the face.

searched_face.face_detail.landmarks[]
Show child fields
searched_face.face_detail.landmarks[].type

Type of landmark.

searched_face.face_detail.landmarks[].x

The x-coordinate of the landmark expressed as a ratio of the width of the image. The x-coordinate is measured from the left-side of the image. For example, if the image is 700 pixels wide and the x-coordinate of the landmark is at 350 pixels, this value is 0.5.

searched_face.face_detail.landmarks[].y

The y-coordinate of the landmark expressed as a ratio of the height of the image. The y-coordinate is measured from the top of the image. For example, if the image height is 200 pixels and the y-coordinate of the landmark is at 50 pixels, this value is 0.25.

searched_face.face_detail.mouth_open

Indicates whether or not the mouth on the face is open, and the confidence level in the determination.

Show child fields
searched_face.face_detail.mouth_open.confidence

Level of confidence in the determination.

searched_face.face_detail.mouth_open.value

Boolean value that indicates whether the mouth on the face is open or not.

searched_face.face_detail.mustache

Indicates whether or not the face has a mustache, and the confidence level in the determination.

Show child fields
searched_face.face_detail.mustache.confidence

Level of confidence in the determination.

searched_face.face_detail.mustache.value

Boolean value that indicates whether the face has mustache or not.

searched_face.face_detail.pose

Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.

Show child fields
searched_face.face_detail.pose.pitch

Value representing the face rotation on the pitch axis.

searched_face.face_detail.pose.roll

Value representing the face rotation on the roll axis.

searched_face.face_detail.pose.yaw

Value representing the face rotation on the yaw axis.

searched_face.face_detail.quality

Identifies image brightness and sharpness. Default attribute.

Show child fields
searched_face.face_detail.quality.brightness

Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.

searched_face.face_detail.quality.sharpness

Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.

searched_face.face_detail.smile

Indicates whether or not the face is smiling, and the confidence level in the determination.

Show child fields
searched_face.face_detail.smile.confidence

Level of confidence in the determination.

searched_face.face_detail.smile.value

Boolean value that indicates whether the face is smiling or not.

searched_face.face_detail.sunglasses

Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.

Show child fields
searched_face.face_detail.sunglasses.confidence

Level of confidence in the determination.

searched_face.face_detail.sunglasses.value

Boolean value that indicates whether the face is wearing sunglasses or not.

unsearched_faces

List of UnsearchedFace objects. Contains the face details infered from the specified image but not used for search. Contains reasons that describe why a face wasn't used for Search.

STRUCT(
"face_details" STRUCT(
"bounding_box" STRUCT(
"width" DOUBLE,
"height" DOUBLE,
"left" DOUBLE,
"top" DOUBLE
),
"age_range" STRUCT(
"low" BIGINT,
"high" BIGINT
),
"smile" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eyeglasses" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"sunglasses" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"gender" STRUCT(
"value" VARCHAR,
"confidence" DOUBLE
),
"beard" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"mustache" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eyes_open" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"mouth_open" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"emotions" STRUCT(
"type" VARCHAR,
"confidence" DOUBLE
)[],
"landmarks" STRUCT(
"type" VARCHAR,
"x" DOUBLE,
"y" DOUBLE
)[],
"pose" STRUCT(
"roll" DOUBLE,
"yaw" DOUBLE,
"pitch" DOUBLE
),
"quality" STRUCT(
"brightness" DOUBLE,
"sharpness" DOUBLE
),
"confidence" DOUBLE,
"face_occluded" STRUCT(
"value" BOOLEAN,
"confidence" DOUBLE
),
"eye_direction" STRUCT(
"yaw" DOUBLE,
"pitch" DOUBLE,
"confidence" DOUBLE
)
),
"reasons" VARCHAR[]
)[]
Show child fields
unsearched_faces[]
Show child fields
unsearched_faces[].face_details

Structure containing attributes of the face that the algorithm detected.

A FaceDetail object contains either the default facial attributes or all facial attributes. The default attributes are BoundingBox, Confidence, Landmarks, Pose, and Quality.

GetFaceDetection is the only Amazon Rekognition Video stored video operation that can return a FaceDetail object with all attributes. To specify which attributes to return, use the FaceAttributes input parameter for StartFaceDetection. The following Amazon Rekognition Video operations return only the default attributes. The corresponding Start operations don't have a FaceAttributes input parameter:

  • GetCelebrityRecognition

  • GetPersonTracking

  • GetFaceSearch

The Amazon Rekognition Image DetectFaces and IndexFaces operations can return all facial attributes. To specify which attributes to return, use the Attributes input parameter for DetectFaces. For IndexFaces, use the DetectAttributes input parameter.

Show child fields
unsearched_faces[].face_details.age_range

The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.

Show child fields
unsearched_faces[].face_details.age_range.high

The highest estimated age.

unsearched_faces[].face_details.age_range.low

The lowest estimated age.

unsearched_faces[].face_details.beard

Indicates whether or not the face has a beard, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.beard.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.beard.value

Boolean value that indicates whether the face has beard or not.

unsearched_faces[].face_details.bounding_box

Bounding box of the face. Default attribute.

Show child fields
unsearched_faces[].face_details.bounding_box.height

Height of the bounding box as a ratio of the overall image height.

unsearched_faces[].face_details.bounding_box.left

Left coordinate of the bounding box as a ratio of overall image width.

unsearched_faces[].face_details.bounding_box.top

Top coordinate of the bounding box as a ratio of overall image height.

unsearched_faces[].face_details.bounding_box.width

Width of the bounding box as a ratio of the overall image width.

unsearched_faces[].face_details.confidence

Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.

unsearched_faces[].face_details.emotions[]
Show child fields
unsearched_faces[].face_details.emotions[].confidence

Level of confidence in the determination.

unsearched_faces[].face_details.emotions[].type

Type of emotion detected.

unsearched_faces[].face_details.eye_direction

Indicates the direction the eyes are gazing in, as defined by pitch and yaw.

Show child fields
unsearched_faces[].face_details.eye_direction.confidence

The confidence that the service has in its predicted eye direction.

unsearched_faces[].face_details.eye_direction.pitch

Value representing eye direction on the pitch axis.

unsearched_faces[].face_details.eye_direction.yaw

Value representing eye direction on the yaw axis.

unsearched_faces[].face_details.eyeglasses

Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.eyeglasses.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.eyeglasses.value

Boolean value that indicates whether the face is wearing eye glasses or not.

unsearched_faces[].face_details.eyes_open

Indicates whether or not the eyes on the face are open, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.eyes_open.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.eyes_open.value

Boolean value that indicates whether the eyes on the face are open.

unsearched_faces[].face_details.face_occluded

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.

Show child fields
unsearched_faces[].face_details.face_occluded.confidence

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

unsearched_faces[].face_details.face_occluded.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.

unsearched_faces[].face_details.gender

The predicted gender of a detected face.

Show child fields
unsearched_faces[].face_details.gender.confidence

Level of confidence in the prediction.

unsearched_faces[].face_details.gender.value

The predicted gender of the face.

unsearched_faces[].face_details.landmarks[]
Show child fields
unsearched_faces[].face_details.landmarks[].type

Type of landmark.

unsearched_faces[].face_details.landmarks[].x

The x-coordinate of the landmark expressed as a ratio of the width of the image. The x-coordinate is measured from the left-side of the image. For example, if the image is 700 pixels wide and the x-coordinate of the landmark is at 350 pixels, this value is 0.5.

unsearched_faces[].face_details.landmarks[].y

The y-coordinate of the landmark expressed as a ratio of the height of the image. The y-coordinate is measured from the top of the image. For example, if the image height is 200 pixels and the y-coordinate of the landmark is at 50 pixels, this value is 0.25.

unsearched_faces[].face_details.mouth_open

Indicates whether or not the mouth on the face is open, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.mouth_open.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.mouth_open.value

Boolean value that indicates whether the mouth on the face is open or not.

unsearched_faces[].face_details.mustache

Indicates whether or not the face has a mustache, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.mustache.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.mustache.value

Boolean value that indicates whether the face has mustache or not.

unsearched_faces[].face_details.pose

Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.

Show child fields
unsearched_faces[].face_details.pose.pitch

Value representing the face rotation on the pitch axis.

unsearched_faces[].face_details.pose.roll

Value representing the face rotation on the roll axis.

unsearched_faces[].face_details.pose.yaw

Value representing the face rotation on the yaw axis.

unsearched_faces[].face_details.quality

Identifies image brightness and sharpness. Default attribute.

Show child fields
unsearched_faces[].face_details.quality.brightness

Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.

unsearched_faces[].face_details.quality.sharpness

Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.

unsearched_faces[].face_details.smile

Indicates whether or not the face is smiling, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.smile.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.smile.value

Boolean value that indicates whether the face is smiling or not.

unsearched_faces[].face_details.sunglasses

Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.

Show child fields
unsearched_faces[].face_details.sunglasses.confidence

Level of confidence in the determination.

unsearched_faces[].face_details.sunglasses.value

Boolean value that indicates whether the face is wearing sunglasses or not.

unsearched_faces[].reasons[]
user_matches

An array of UserID objects that matched the input face, along with the confidence in the match. The returned structure will be empty if there are no matches. Returned if the SearchUsersByImageResponse action is successful.

STRUCT(
"similarity" DOUBLE,
"user" STRUCT(
"user_id" VARCHAR,
"user_status" VARCHAR
)
)[]
Show child fields
user_matches[]
Show child fields
user_matches[].similarity

Describes the UserID metadata.

user_matches[].user

Confidence in the match of this UserID with the input face.

Show child fields
user_matches[].user.user_id

A provided ID for the UserID. Unique within the collection.

user_matches[].user.user_status

The status of the user matched to a provided FaceID.