2023/04/28 - Amazon Rekognition - 8 updated api methods
Changes Added support for aggregating moderation labels by video segment timestamps for Stored Video Content Moderation APIs and added additional information about the job to all Stored Video Get API responses.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the celebrity recognition results for a Amazon Rekognition Video analysis started by StartCelebrityRecognition .
Celebrity recognition in a video is an asynchronous operation. Analysis is started by a call to StartCelebrityRecognition which returns a job identifier (JobId ).
When the celebrity recognition operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartCelebrityRecognition . To get the results of the celebrity recognition analysis, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetCelebrityDetection and pass the job identifier (JobId ) from the initial call to StartCelebrityDetection .
For more information, see Working With Stored Videos in the Amazon Rekognition Developer Guide.
GetCelebrityRecognition returns detected celebrities and the time(s) they are detected in an array (Celebrities ) of CelebrityRecognition objects. Each CelebrityRecognition contains information about the celebrity in a CelebrityDetail object and the time, Timestamp , the celebrity was detected. This CelebrityDetail object stores information about the detected celebrity's face attributes, a face bounding box, known gender, the celebrity's name, and a confidence estimate.
Note
GetCelebrityRecognition only returns the default facial attributes (BoundingBox , Confidence , Landmarks , Pose , and Quality ). The BoundingBox field only applies to the detected face instance. The other facial attributes listed in the Face object of the following response syntax are not returned. For more information, see FaceDetail in the Amazon Rekognition Developer Guide.
By default, the Celebrities array is sorted by time (milliseconds from the start of the video). You can also sort the array by celebrity by specifying the value ID in the SortBy input parameter.
The CelebrityDetail object includes the celebrity identifer and additional information urls. If you don't store the additional information urls, you can get them later by calling GetCelebrityInfo with the celebrity identifer.
No information is returned for faces not recognized as celebrities.
Use MaxResults parameter to limit the number of labels returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetCelebrityDetection and populate the NextToken request parameter with the token value returned from the previous call to GetCelebrityRecognition .
See also: AWS API Documentation
Request Syntax
client.get_celebrity_recognition( JobId='string', MaxResults=123, NextToken='string', SortBy='ID'|'TIMESTAMP' )
string
[REQUIRED]
Job identifier for the required celebrity recognition analysis. You can get the job identifer from a call to StartCelebrityRecognition .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there is more recognized celebrities to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of celebrities.
string
Sort to use for celebrities returned in Celebrities field. Specify ID to sort by the celebrity identifier, specify TIMESTAMP to sort by the time the celebrity was recognized.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'NextToken': 'string', 'Celebrities': [ { 'Timestamp': 123, 'Celebrity': { 'Urls': [ 'string', ], 'Name': 'string', 'Id': 'string', 'Confidence': ..., 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'Face': { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'AgeRange': { 'Low': 123, 'High': 123 }, 'Smile': { 'Value': True|False, 'Confidence': ... }, 'Eyeglasses': { 'Value': True|False, 'Confidence': ... }, 'Sunglasses': { 'Value': True|False, 'Confidence': ... }, 'Gender': { 'Value': 'Male'|'Female', 'Confidence': ... }, 'Beard': { 'Value': True|False, 'Confidence': ... }, 'Mustache': { 'Value': True|False, 'Confidence': ... }, 'EyesOpen': { 'Value': True|False, 'Confidence': ... }, 'MouthOpen': { 'Value': True|False, 'Confidence': ... }, 'Emotions': [ { 'Type': 'HAPPY'|'SAD'|'ANGRY'|'CONFUSED'|'DISGUSTED'|'SURPRISED'|'CALM'|'UNKNOWN'|'FEAR', 'Confidence': ... }, ], 'Landmarks': [ { 'Type': 'eyeLeft'|'eyeRight'|'nose'|'mouthLeft'|'mouthRight'|'leftEyeBrowLeft'|'leftEyeBrowRight'|'leftEyeBrowUp'|'rightEyeBrowLeft'|'rightEyeBrowRight'|'rightEyeBrowUp'|'leftEyeLeft'|'leftEyeRight'|'leftEyeUp'|'leftEyeDown'|'rightEyeLeft'|'rightEyeRight'|'rightEyeUp'|'rightEyeDown'|'noseLeft'|'noseRight'|'mouthUp'|'mouthDown'|'leftPupil'|'rightPupil'|'upperJawlineLeft'|'midJawlineLeft'|'chinBottom'|'midJawlineRight'|'upperJawlineRight', 'X': ..., 'Y': ... }, ], 'Pose': { 'Roll': ..., 'Yaw': ..., 'Pitch': ... }, 'Quality': { 'Brightness': ..., 'Sharpness': ... }, 'Confidence': ... }, 'KnownGender': { 'Type': 'Male'|'Female'|'Nonbinary'|'Unlisted' } } }, ], 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
The current status of the celebrity recognition job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition Video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of celebrities.
Celebrities (list) --
Array of celebrities recognized in the video.
(dict) --
Information about a detected celebrity and the time the celebrity was detected in a stored video. For more information, see GetCelebrityRecognition in the Amazon Rekognition Developer Guide.
Timestamp (integer) --
The time, in milliseconds from the start of the video, that the celebrity was recognized. Note that Timestamp is not guaranteed to be accurate to the individual frame where the celebrity first appears.
Celebrity (dict) --
Information about a recognized celebrity.
Urls (list) --
An array of URLs pointing to additional celebrity information.
(string) --
Name (string) --
The name of the celebrity.
Id (string) --
The unique identifier for the celebrity.
Confidence (float) --
The confidence, in percentage, that Amazon Rekognition has that the recognized face is the celebrity.
BoundingBox (dict) --
Bounding box around the body of a celebrity.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
Face (dict) --
Face details for the recognized celebrity.
BoundingBox (dict) --
Bounding box of the face. Default attribute.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
AgeRange (dict) --
The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.
Low (integer) --
The lowest estimated age.
High (integer) --
The highest estimated age.
Smile (dict) --
Indicates whether or not the face is smiling, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is smiling or not.
Confidence (float) --
Level of confidence in the determination.
Eyeglasses (dict) --
Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing eye glasses or not.
Confidence (float) --
Level of confidence in the determination.
Sunglasses (dict) --
Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing sunglasses or not.
Confidence (float) --
Level of confidence in the determination.
Gender (dict) --
The predicted gender of a detected face.
Value (string) --
The predicted gender of the face.
Confidence (float) --
Level of confidence in the prediction.
Beard (dict) --
Indicates whether or not the face has a beard, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has beard or not.
Confidence (float) --
Level of confidence in the determination.
Mustache (dict) --
Indicates whether or not the face has a mustache, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has mustache or not.
Confidence (float) --
Level of confidence in the determination.
EyesOpen (dict) --
Indicates whether or not the eyes on the face are open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the eyes on the face are open.
Confidence (float) --
Level of confidence in the determination.
MouthOpen (dict) --
Indicates whether or not the mouth on the face is open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the mouth on the face is open or not.
Confidence (float) --
Level of confidence in the determination.
Emotions (list) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
(dict) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
Type (string) --
Type of emotion detected.
Confidence (float) --
Level of confidence in the determination.
Landmarks (list) --
Indicates the location of landmarks on the face. Default attribute.
(dict) --
Indicates the location of the landmark on the face.
Type (string) --
Type of landmark.
X (float) --
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.
Y (float) --
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.
Pose (dict) --
Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.
Roll (float) --
Value representing the face rotation on the roll axis.
Yaw (float) --
Value representing the face rotation on the yaw axis.
Pitch (float) --
Value representing the face rotation on the pitch axis.
Quality (dict) --
Identifies image brightness and sharpness. Default attribute.
Brightness (float) --
Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.
Sharpness (float) --
Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.
Confidence (float) --
Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.
KnownGender (dict) --
Retrieves the known gender for the celebrity.
Type (string) --
A string value of the KnownGender info about the Celebrity.
JobId (string) --
Job identifier for the celebrity recognition operation for which you want to obtain results. The job identifer is returned by an initial call to StartCelebrityRecognition.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartCelebrityRecognition and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
{'AggregateBy': 'TIMESTAMPS | SEGMENTS'}Response
{'GetRequestMetadata': {'AggregateBy': 'TIMESTAMPS | SEGMENTS', 'SortBy': 'NAME | TIMESTAMP'}, 'JobId': 'string', 'JobTag': 'string', 'ModerationLabels': {'DurationMillis': 'long', 'EndTimestampMillis': 'long', 'StartTimestampMillis': 'long'}, 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the inappropriate, unwanted, or offensive content analysis results for a Amazon Rekognition Video analysis started by StartContentModeration . For a list of moderation labels in Amazon Rekognition, see Using the image and video moderation APIs .
Amazon Rekognition Video inappropriate or offensive content detection in a stored video is an asynchronous operation. You start analysis by calling StartContentModeration which returns a job identifier (JobId ). When analysis finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartContentModeration . To get the results of the content analysis, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetContentModeration and pass the job identifier (JobId ) from the initial call to StartContentModeration .
For more information, see Working with Stored Videos in the Amazon Rekognition Devlopers Guide.
GetContentModeration returns detected inappropriate, unwanted, or offensive content moderation labels, and the time they are detected, in an array, ModerationLabels , of ContentModerationDetection objects.
By default, the moderated labels are returned sorted by time, in milliseconds from the start of the video. You can also sort them by moderated label by specifying NAME for the SortBy input parameter.
Since video analysis can return a large number of results, use the MaxResults parameter to limit the number of labels returned in a single call to GetContentModeration . If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetContentModeration and populate the NextToken request parameter with the value of NextToken returned from the previous call to GetContentModeration .
For more information, see moderating content in the Amazon Rekognition Developer Guide.
See also: AWS API Documentation
Request Syntax
client.get_content_moderation( JobId='string', MaxResults=123, NextToken='string', SortBy='NAME'|'TIMESTAMP', AggregateBy='TIMESTAMPS'|'SEGMENTS' )
string
[REQUIRED]
The identifier for the inappropriate, unwanted, or offensive content moderation job. Use JobId to identify the job in a subsequent call to GetContentModeration .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there is more data to retrieve), Amazon Rekognition returns a pagination token in the response. You can use this pagination token to retrieve the next set of content moderation labels.
string
Sort to use for elements in the ModerationLabelDetections array. Use TIMESTAMP to sort array elements by the time labels are detected. Use NAME to alphabetically group elements for a label together. Within each label group, the array element are sorted by detection confidence. The default sort is by TIMESTAMP .
string
Defines how to aggregate results of the StartContentModeration request. Default aggregation option is TIMESTAMPS. SEGMENTS mode aggregates moderation labels over time.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'ModerationLabels': [ { 'Timestamp': 123, 'ModerationLabel': { 'Confidence': ..., 'Name': 'string', 'ParentName': 'string' }, 'StartTimestampMillis': 123, 'EndTimestampMillis': 123, 'DurationMillis': 123 }, ], 'NextToken': 'string', 'ModerationModelVersion': 'string', 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string', 'GetRequestMetadata': { 'SortBy': 'NAME'|'TIMESTAMP', 'AggregateBy': 'TIMESTAMPS'|'SEGMENTS' } }
Response Structure
(dict) --
JobStatus (string) --
The current status of the content moderation analysis job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition analyzed. Videometadata is returned in every page of paginated responses from GetContentModeration .
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
ModerationLabels (list) --
The detected inappropriate, unwanted, or offensive content moderation labels and the time(s) they were detected.
(dict) --
Information about an inappropriate, unwanted, or offensive content label detection in a stored video.
Timestamp (integer) --
Time, in milliseconds from the beginning of the video, that the content moderation label was detected. Note that Timestamp is not guaranteed to be accurate to the individual frame where the moderated content first appears.
ModerationLabel (dict) --
The content moderation label detected by in the stored video.
Confidence (float) --
Specifies the confidence that Amazon Rekognition has that the label has been correctly identified.
If you don't specify the MinConfidence parameter in the call to DetectModerationLabels , the operation returns labels with a confidence value greater than or equal to 50 percent.
Name (string) --
The label name for the type of unsafe content detected in the image.
ParentName (string) --
The name for the parent label. Labels at the top level of the hierarchy have the parent label "" .
StartTimestampMillis (integer) --
The time in milliseconds defining the start of the timeline segment containing a continuously detected moderation label.
EndTimestampMillis (integer) --
The time in milliseconds defining the end of the timeline segment containing a continuously detected moderation label.
DurationMillis (integer) --
The time duration of a segment in milliseconds, I.e. time elapsed from StartTimestampMillis to EndTimestampMillis.
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of content moderation labels.
ModerationModelVersion (string) --
Version number of the moderation detection model that was used to detect inappropriate, unwanted, or offensive content.
JobId (string) --
Job identifier for the content moderation operation for which you want to obtain results. The job identifer is returned by an initial call to StartContentModeration.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartContentModeration and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
GetRequestMetadata (dict) --
Information about the paramters used when getting a response. Includes information on aggregation and sorting methods.
SortBy (string) --
The sorting method chosen for a GetContentModeration request.
AggregateBy (string) --
The aggregation method chosen for a GetContentModeration request.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets face detection results for a Amazon Rekognition Video analysis started by StartFaceDetection .
Face detection with Amazon Rekognition Video is an asynchronous operation. You start face detection by calling StartFaceDetection which returns a job identifier (JobId ). When the face detection operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartFaceDetection . To get the results of the face detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetFaceDetection and pass the job identifier (JobId ) from the initial call to StartFaceDetection .
GetFaceDetection returns an array of detected faces (Faces ) sorted by the time the faces were detected.
Use MaxResults parameter to limit the number of labels returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetFaceDetection and populate the NextToken request parameter with the token value returned from the previous call to GetFaceDetection .
See also: AWS API Documentation
Request Syntax
client.get_face_detection( JobId='string', MaxResults=123, NextToken='string' )
string
[REQUIRED]
Unique identifier for the face detection job. The JobId is returned from StartFaceDetection .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there are more faces to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of faces.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'NextToken': 'string', 'Faces': [ { 'Timestamp': 123, 'Face': { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'AgeRange': { 'Low': 123, 'High': 123 }, 'Smile': { 'Value': True|False, 'Confidence': ... }, 'Eyeglasses': { 'Value': True|False, 'Confidence': ... }, 'Sunglasses': { 'Value': True|False, 'Confidence': ... }, 'Gender': { 'Value': 'Male'|'Female', 'Confidence': ... }, 'Beard': { 'Value': True|False, 'Confidence': ... }, 'Mustache': { 'Value': True|False, 'Confidence': ... }, 'EyesOpen': { 'Value': True|False, 'Confidence': ... }, 'MouthOpen': { 'Value': True|False, 'Confidence': ... }, 'Emotions': [ { 'Type': 'HAPPY'|'SAD'|'ANGRY'|'CONFUSED'|'DISGUSTED'|'SURPRISED'|'CALM'|'UNKNOWN'|'FEAR', 'Confidence': ... }, ], 'Landmarks': [ { 'Type': 'eyeLeft'|'eyeRight'|'nose'|'mouthLeft'|'mouthRight'|'leftEyeBrowLeft'|'leftEyeBrowRight'|'leftEyeBrowUp'|'rightEyeBrowLeft'|'rightEyeBrowRight'|'rightEyeBrowUp'|'leftEyeLeft'|'leftEyeRight'|'leftEyeUp'|'leftEyeDown'|'rightEyeLeft'|'rightEyeRight'|'rightEyeUp'|'rightEyeDown'|'noseLeft'|'noseRight'|'mouthUp'|'mouthDown'|'leftPupil'|'rightPupil'|'upperJawlineLeft'|'midJawlineLeft'|'chinBottom'|'midJawlineRight'|'upperJawlineRight', 'X': ..., 'Y': ... }, ], 'Pose': { 'Roll': ..., 'Yaw': ..., 'Pitch': ... }, 'Quality': { 'Brightness': ..., 'Sharpness': ... }, 'Confidence': ... } }, ], 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
The current status of the face detection job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
NextToken (string) --
If the response is truncated, Amazon Rekognition returns this token that you can use in the subsequent request to retrieve the next set of faces.
Faces (list) --
An array of faces detected in the video. Each element contains a detected face's details and the time, in milliseconds from the start of the video, the face was detected.
(dict) --
Information about a face detected in a video analysis request and the time the face was detected in the video.
Timestamp (integer) --
Time, in milliseconds from the start of the video, that the face was detected. Note that Timestamp is not guaranteed to be accurate to the individual frame where the face first appears.
Face (dict) --
The face properties for the detected face.
BoundingBox (dict) --
Bounding box of the face. Default attribute.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
AgeRange (dict) --
The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.
Low (integer) --
The lowest estimated age.
High (integer) --
The highest estimated age.
Smile (dict) --
Indicates whether or not the face is smiling, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is smiling or not.
Confidence (float) --
Level of confidence in the determination.
Eyeglasses (dict) --
Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing eye glasses or not.
Confidence (float) --
Level of confidence in the determination.
Sunglasses (dict) --
Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing sunglasses or not.
Confidence (float) --
Level of confidence in the determination.
Gender (dict) --
The predicted gender of a detected face.
Value (string) --
The predicted gender of the face.
Confidence (float) --
Level of confidence in the prediction.
Beard (dict) --
Indicates whether or not the face has a beard, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has beard or not.
Confidence (float) --
Level of confidence in the determination.
Mustache (dict) --
Indicates whether or not the face has a mustache, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has mustache or not.
Confidence (float) --
Level of confidence in the determination.
EyesOpen (dict) --
Indicates whether or not the eyes on the face are open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the eyes on the face are open.
Confidence (float) --
Level of confidence in the determination.
MouthOpen (dict) --
Indicates whether or not the mouth on the face is open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the mouth on the face is open or not.
Confidence (float) --
Level of confidence in the determination.
Emotions (list) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
(dict) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
Type (string) --
Type of emotion detected.
Confidence (float) --
Level of confidence in the determination.
Landmarks (list) --
Indicates the location of landmarks on the face. Default attribute.
(dict) --
Indicates the location of the landmark on the face.
Type (string) --
Type of landmark.
X (float) --
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.
Y (float) --
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.
Pose (dict) --
Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.
Roll (float) --
Value representing the face rotation on the roll axis.
Yaw (float) --
Value representing the face rotation on the yaw axis.
Pitch (float) --
Value representing the face rotation on the pitch axis.
Quality (dict) --
Identifies image brightness and sharpness. Default attribute.
Brightness (float) --
Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.
Sharpness (float) --
Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.
Confidence (float) --
Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.
JobId (string) --
Job identifier for the face detection operation for which you want to obtain results. The job identifer is returned by an initial call to StartFaceDetection.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartFaceDetection and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the face search results for Amazon Rekognition Video face search started by StartFaceSearch . The search returns faces in a collection that match the faces of persons detected in a video. It also includes the time(s) that faces are matched in the video.
Face search in a video is an asynchronous operation. You start face search by calling to StartFaceSearch which returns a job identifier (JobId ). When the search operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartFaceSearch . To get the search results, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetFaceSearch and pass the job identifier (JobId ) from the initial call to StartFaceSearch .
For more information, see Searching Faces in a Collection in the Amazon Rekognition Developer Guide.
The search results are retured in an array, Persons , of PersonMatch objects. Each``PersonMatch`` element contains details about the matching faces in the input collection, person information (facial attributes, bounding boxes, and person identifer) for the matched person, and the time the person was matched in the video.
Note
GetFaceSearch only returns the default facial attributes (BoundingBox , Confidence , Landmarks , Pose , and Quality ). The other facial attributes listed in the Face object of the following response syntax are not returned. For more information, see FaceDetail in the Amazon Rekognition Developer Guide.
By default, the Persons array is sorted by the time, in milliseconds from the start of the video, persons are matched. You can also sort by persons by specifying INDEX for the SORTBY input parameter.
See also: AWS API Documentation
Request Syntax
client.get_face_search( JobId='string', MaxResults=123, NextToken='string', SortBy='INDEX'|'TIMESTAMP' )
string
[REQUIRED]
The job identifer for the search request. You get the job identifier from an initial call to StartFaceSearch .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there is more search results to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of search results.
string
Sort to use for grouping faces in the response. Use TIMESTAMP to group faces by the time that they are recognized. Use INDEX to sort by recognized faces.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'NextToken': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'Persons': [ { 'Timestamp': 123, 'Person': { 'Index': 123, 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'Face': { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'AgeRange': { 'Low': 123, 'High': 123 }, 'Smile': { 'Value': True|False, 'Confidence': ... }, 'Eyeglasses': { 'Value': True|False, 'Confidence': ... }, 'Sunglasses': { 'Value': True|False, 'Confidence': ... }, 'Gender': { 'Value': 'Male'|'Female', 'Confidence': ... }, 'Beard': { 'Value': True|False, 'Confidence': ... }, 'Mustache': { 'Value': True|False, 'Confidence': ... }, 'EyesOpen': { 'Value': True|False, 'Confidence': ... }, 'MouthOpen': { 'Value': True|False, 'Confidence': ... }, 'Emotions': [ { 'Type': 'HAPPY'|'SAD'|'ANGRY'|'CONFUSED'|'DISGUSTED'|'SURPRISED'|'CALM'|'UNKNOWN'|'FEAR', 'Confidence': ... }, ], 'Landmarks': [ { 'Type': 'eyeLeft'|'eyeRight'|'nose'|'mouthLeft'|'mouthRight'|'leftEyeBrowLeft'|'leftEyeBrowRight'|'leftEyeBrowUp'|'rightEyeBrowLeft'|'rightEyeBrowRight'|'rightEyeBrowUp'|'leftEyeLeft'|'leftEyeRight'|'leftEyeUp'|'leftEyeDown'|'rightEyeLeft'|'rightEyeRight'|'rightEyeUp'|'rightEyeDown'|'noseLeft'|'noseRight'|'mouthUp'|'mouthDown'|'leftPupil'|'rightPupil'|'upperJawlineLeft'|'midJawlineLeft'|'chinBottom'|'midJawlineRight'|'upperJawlineRight', 'X': ..., 'Y': ... }, ], 'Pose': { 'Roll': ..., 'Yaw': ..., 'Pitch': ... }, 'Quality': { 'Brightness': ..., 'Sharpness': ... }, 'Confidence': ... } }, 'FaceMatches': [ { 'Similarity': ..., 'Face': { 'FaceId': 'string', 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'ImageId': 'string', 'ExternalImageId': 'string', 'Confidence': ..., 'IndexFacesModelVersion': 'string' } }, ] }, ], 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
The current status of the face search job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of search results.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition Video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
Persons (list) --
An array of persons, PersonMatch , in the video whose face(s) match the face(s) in an Amazon Rekognition collection. It also includes time information for when persons are matched in the video. You specify the input collection in an initial call to StartFaceSearch . Each Persons element includes a time the person was matched, face match details (FaceMatches ) for matching faces in the collection, and person information (Person ) for the matched person.
(dict) --
Information about a person whose face matches a face(s) in an Amazon Rekognition collection. Includes information about the faces in the Amazon Rekognition collection ( FaceMatch ), information about the person ( PersonDetail ), and the time stamp for when the person was detected in a video. An array of PersonMatch objects is returned by GetFaceSearch .
Timestamp (integer) --
The time, in milliseconds from the beginning of the video, that the person was matched in the video.
Person (dict) --
Information about the matched person.
Index (integer) --
Identifier for the person detected person within a video. Use to keep track of the person throughout the video. The identifier is not stored by Amazon Rekognition.
BoundingBox (dict) --
Bounding box around the detected person.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
Face (dict) --
Face details for the detected person.
BoundingBox (dict) --
Bounding box of the face. Default attribute.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
AgeRange (dict) --
The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.
Low (integer) --
The lowest estimated age.
High (integer) --
The highest estimated age.
Smile (dict) --
Indicates whether or not the face is smiling, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is smiling or not.
Confidence (float) --
Level of confidence in the determination.
Eyeglasses (dict) --
Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing eye glasses or not.
Confidence (float) --
Level of confidence in the determination.
Sunglasses (dict) --
Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing sunglasses or not.
Confidence (float) --
Level of confidence in the determination.
Gender (dict) --
The predicted gender of a detected face.
Value (string) --
The predicted gender of the face.
Confidence (float) --
Level of confidence in the prediction.
Beard (dict) --
Indicates whether or not the face has a beard, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has beard or not.
Confidence (float) --
Level of confidence in the determination.
Mustache (dict) --
Indicates whether or not the face has a mustache, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has mustache or not.
Confidence (float) --
Level of confidence in the determination.
EyesOpen (dict) --
Indicates whether or not the eyes on the face are open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the eyes on the face are open.
Confidence (float) --
Level of confidence in the determination.
MouthOpen (dict) --
Indicates whether or not the mouth on the face is open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the mouth on the face is open or not.
Confidence (float) --
Level of confidence in the determination.
Emotions (list) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
(dict) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
Type (string) --
Type of emotion detected.
Confidence (float) --
Level of confidence in the determination.
Landmarks (list) --
Indicates the location of landmarks on the face. Default attribute.
(dict) --
Indicates the location of the landmark on the face.
Type (string) --
Type of landmark.
X (float) --
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.
Y (float) --
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.
Pose (dict) --
Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.
Roll (float) --
Value representing the face rotation on the roll axis.
Yaw (float) --
Value representing the face rotation on the yaw axis.
Pitch (float) --
Value representing the face rotation on the pitch axis.
Quality (dict) --
Identifies image brightness and sharpness. Default attribute.
Brightness (float) --
Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.
Sharpness (float) --
Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.
Confidence (float) --
Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.
FaceMatches (list) --
Information about the faces in the input collection that match the face of a person in the video.
(dict) --
Provides face metadata. In addition, it also provides the confidence in the match of this face with the input face.
Similarity (float) --
Confidence in the match of this face with the input face.
Face (dict) --
Describes the face properties such as the bounding box, face ID, image ID of the source image, and external image ID that you assigned.
FaceId (string) --
Unique identifier that Amazon Rekognition assigns to the face.
BoundingBox (dict) --
Bounding box of the face.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
ImageId (string) --
Unique identifier that Amazon Rekognition assigns to the input image.
ExternalImageId (string) --
Identifier that you assign to all the faces in the input image.
Confidence (float) --
Confidence level that the bounding box contains a face (and not a different object such as a tree).
IndexFacesModelVersion (string) --
The version of the face detect and storage model that was used when indexing the face vector.
JobId (string) --
Job identifier for the face search operation for which you want to obtain results. The job identifer is returned by an initial call to StartFaceSearch.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartFaceSearch and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
{'GetRequestMetadata': {'AggregateBy': 'TIMESTAMPS | SEGMENTS', 'SortBy': 'NAME | TIMESTAMP'}, 'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the label detection results of a Amazon Rekognition Video analysis started by StartLabelDetection .
The label detection operation is started by a call to StartLabelDetection which returns a job identifier (JobId ). When the label detection operation finishes, Amazon Rekognition publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartlabelDetection .
To get the results of the label detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetLabelDetection and pass the job identifier (JobId ) from the initial call to StartLabelDetection .
GetLabelDetection returns an array of detected labels (Labels ) sorted by the time the labels were detected. You can also sort by the label name by specifying NAME for the SortBy input parameter. If there is no NAME specified, the default sort is by timestamp.
You can select how results are aggregated by using the AggregateBy input parameter. The default aggregation method is TIMESTAMPS . You can also aggregate by SEGMENTS , which aggregates all instances of labels detected in a given segment.
The returned Labels array may include the following attributes:
Name - The name of the detected label.
Confidence - The level of confidence in the label assigned to a detected object.
Parents - The ancestor labels for a detected label. GetLabelDetection returns a hierarchical taxonomy of detected labels. For example, a detected car might be assigned the label car. The label car has two parent labels: Vehicle (its parent) and Transportation (its grandparent). The response includes the all ancestors for a label, where every ancestor is a unique label. In the previous example, Car, Vehicle, and Transportation are returned as unique labels in the response.
Aliases - Possible Aliases for the label.
Categories - The label categories that the detected label belongs to.
BoundingBox — Bounding boxes are described for all instances of detected common object labels, returned in an array of Instance objects. An Instance object contains a BoundingBox object, describing the location of the label on the input image. It also includes the confidence for the accuracy of the detected bounding box.
Timestamp - Time, in milliseconds from the start of the video, that the label was detected. For aggregation by SEGMENTS , the StartTimestampMillis , EndTimestampMillis , and DurationMillis structures are what define a segment. Although the “Timestamp” structure is still returned with each label, its value is set to be the same as StartTimestampMillis .
Timestamp and Bounding box information are returned for detected Instances, only if aggregation is done by TIMESTAMPS . If aggregating by SEGMENTS , information about detected instances isn’t returned.
The version of the label model used for the detection is also returned.
Note ``DominantColors`` isn't returned for ``Instances`` , although it is shown as part of the response in the sample seen below.
Use MaxResults parameter to limit the number of labels returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetlabelDetection and populate the NextToken request parameter with the token value returned from the previous call to GetLabelDetection .
See also: AWS API Documentation
Request Syntax
client.get_label_detection( JobId='string', MaxResults=123, NextToken='string', SortBy='NAME'|'TIMESTAMP', AggregateBy='TIMESTAMPS'|'SEGMENTS' )
string
[REQUIRED]
Job identifier for the label detection operation for which you want results returned. You get the job identifer from an initial call to StartlabelDetection .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there are more labels to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of labels.
string
Sort to use for elements in the Labels array. Use TIMESTAMP to sort array elements by the time labels are detected. Use NAME to alphabetically group elements for a label together. Within each label group, the array element are sorted by detection confidence. The default sort is by TIMESTAMP .
string
Defines how to aggregate the returned results. Results can be aggregated by timestamps or segments.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'NextToken': 'string', 'Labels': [ { 'Timestamp': 123, 'Label': { 'Name': 'string', 'Confidence': ..., 'Instances': [ { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'Confidence': ..., 'DominantColors': [ { 'Red': 123, 'Blue': 123, 'Green': 123, 'HexCode': 'string', 'CSSColor': 'string', 'SimplifiedColor': 'string', 'PixelPercent': ... }, ] }, ], 'Parents': [ { 'Name': 'string' }, ], 'Aliases': [ { 'Name': 'string' }, ], 'Categories': [ { 'Name': 'string' }, ] }, 'StartTimestampMillis': 123, 'EndTimestampMillis': 123, 'DurationMillis': 123 }, ], 'LabelModelVersion': 'string', 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string', 'GetRequestMetadata': { 'SortBy': 'NAME'|'TIMESTAMP', 'AggregateBy': 'TIMESTAMPS'|'SEGMENTS' } }
Response Structure
(dict) --
JobStatus (string) --
The current status of the label detection job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of labels.
Labels (list) --
An array of labels detected in the video. Each element contains the detected label and the time, in milliseconds from the start of the video, that the label was detected.
(dict) --
Information about a label detected in a video analysis request and the time the label was detected in the video.
Timestamp (integer) --
Time, in milliseconds from the start of the video, that the label was detected. Note that Timestamp is not guaranteed to be accurate to the individual frame where the label first appears.
Label (dict) --
Details about the detected label.
Name (string) --
The name (label) of the object or scene.
Confidence (float) --
Level of confidence.
Instances (list) --
If Label represents an object, Instances contains the bounding boxes for each instance of the detected object. Bounding boxes are returned for common object labels such as people, cars, furniture, apparel or pets.
(dict) --
An instance of a label returned by Amazon Rekognition Image ( DetectLabels ) or by Amazon Rekognition Video ( GetLabelDetection ).
BoundingBox (dict) --
The position of the label instance on the image.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
Confidence (float) --
The confidence that Amazon Rekognition has in the accuracy of the bounding box.
DominantColors (list) --
The dominant colors found in an individual instance of a label.
(dict) --
A description of the dominant colors in an image.
Red (integer) --
The Red RGB value for a dominant color.
Blue (integer) --
The Blue RGB value for a dominant color.
Green (integer) --
The Green RGB value for a dominant color.
HexCode (string) --
The Hex code equivalent of the RGB values for a dominant color.
CSSColor (string) --
The CSS color name of a dominant color.
SimplifiedColor (string) --
One of 12 simplified color names applied to a dominant color.
PixelPercent (float) --
The percentage of image pixels that have a given dominant color.
Parents (list) --
The parent labels for a label. The response includes all ancestor labels.
(dict) --
A parent label for a label. A label can have 0, 1, or more parents.
Name (string) --
The name of the parent label.
Aliases (list) --
A list of potential aliases for a given label.
(dict) --
A potential alias of for a given label.
Name (string) --
The name of an alias for a given label.
Categories (list) --
A list of the categories associated with a given label.
(dict) --
The category that applies to a given label.
Name (string) --
The name of a category that applies to a given label.
StartTimestampMillis (integer) --
The time in milliseconds defining the start of the timeline segment containing a continuously detected label.
EndTimestampMillis (integer) --
The time in milliseconds defining the end of the timeline segment containing a continuously detected label.
DurationMillis (integer) --
The time duration of a segment in milliseconds, I.e. time elapsed from StartTimestampMillis to EndTimestampMillis.
LabelModelVersion (string) --
Version number of the label detection model that was used to detect labels.
JobId (string) --
Job identifier for the label detection operation for which you want to obtain results. The job identifer is returned by an initial call to StartLabelDetection.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartLabelDetection and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
GetRequestMetadata (dict) --
Information about the paramters used when getting a response. Includes information on aggregation and sorting methods.
SortBy (string) --
The sorting method chosen for a GetLabelDetection request.
AggregateBy (string) --
The aggregation method chosen for a GetLabelDetection request.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the path tracking results of a Amazon Rekognition Video analysis started by StartPersonTracking .
The person path tracking operation is started by a call to StartPersonTracking which returns a job identifier (JobId ). When the operation finishes, Amazon Rekognition Video publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartPersonTracking .
To get the results of the person path tracking operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . If so, call GetPersonTracking and pass the job identifier (JobId ) from the initial call to StartPersonTracking .
GetPersonTracking returns an array, Persons , of tracked persons and the time(s) their paths were tracked in the video.
Note
GetPersonTracking only returns the default facial attributes (BoundingBox , Confidence , Landmarks , Pose , and Quality ). The other facial attributes listed in the Face object of the following response syntax are not returned.
For more information, see FaceDetail in the Amazon Rekognition Developer Guide.
By default, the array is sorted by the time(s) a person's path is tracked in the video. You can sort by tracked persons by specifying INDEX for the SortBy input parameter.
Use the MaxResults parameter to limit the number of items returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetPersonTracking and populate the NextToken request parameter with the token value returned from the previous call to GetPersonTracking .
See also: AWS API Documentation
Request Syntax
client.get_person_tracking( JobId='string', MaxResults=123, NextToken='string', SortBy='INDEX'|'TIMESTAMP' )
string
[REQUIRED]
The identifier for a job that tracks persons in a video. You get the JobId from a call to StartPersonTracking .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 results is returned. The default value is 1000.
string
If the previous response was incomplete (because there are more persons to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of persons.
string
Sort to use for elements in the Persons array. Use TIMESTAMP to sort array elements by the time persons are detected. Use INDEX to sort by the tracked persons. If you sort by INDEX , the array elements for each person are sorted by detection confidence. The default sort is by TIMESTAMP .
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'NextToken': 'string', 'Persons': [ { 'Timestamp': 123, 'Person': { 'Index': 123, 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'Face': { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'AgeRange': { 'Low': 123, 'High': 123 }, 'Smile': { 'Value': True|False, 'Confidence': ... }, 'Eyeglasses': { 'Value': True|False, 'Confidence': ... }, 'Sunglasses': { 'Value': True|False, 'Confidence': ... }, 'Gender': { 'Value': 'Male'|'Female', 'Confidence': ... }, 'Beard': { 'Value': True|False, 'Confidence': ... }, 'Mustache': { 'Value': True|False, 'Confidence': ... }, 'EyesOpen': { 'Value': True|False, 'Confidence': ... }, 'MouthOpen': { 'Value': True|False, 'Confidence': ... }, 'Emotions': [ { 'Type': 'HAPPY'|'SAD'|'ANGRY'|'CONFUSED'|'DISGUSTED'|'SURPRISED'|'CALM'|'UNKNOWN'|'FEAR', 'Confidence': ... }, ], 'Landmarks': [ { 'Type': 'eyeLeft'|'eyeRight'|'nose'|'mouthLeft'|'mouthRight'|'leftEyeBrowLeft'|'leftEyeBrowRight'|'leftEyeBrowUp'|'rightEyeBrowLeft'|'rightEyeBrowRight'|'rightEyeBrowUp'|'leftEyeLeft'|'leftEyeRight'|'leftEyeUp'|'leftEyeDown'|'rightEyeLeft'|'rightEyeRight'|'rightEyeUp'|'rightEyeDown'|'noseLeft'|'noseRight'|'mouthUp'|'mouthDown'|'leftPupil'|'rightPupil'|'upperJawlineLeft'|'midJawlineLeft'|'chinBottom'|'midJawlineRight'|'upperJawlineRight', 'X': ..., 'Y': ... }, ], 'Pose': { 'Roll': ..., 'Yaw': ..., 'Pitch': ... }, 'Quality': { 'Brightness': ..., 'Sharpness': ... }, 'Confidence': ... } } }, ], 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
The current status of the person tracking job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition Video analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition Video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of persons.
Persons (list) --
An array of the persons detected in the video and the time(s) their path was tracked throughout the video. An array element will exist for each time a person's path is tracked.
(dict) --
Details and path tracking information for a single time a person's path is tracked in a video. Amazon Rekognition operations that track people's paths return an array of PersonDetection objects with elements for each time a person's path is tracked in a video.
For more information, see GetPersonTracking in the Amazon Rekognition Developer Guide.
Timestamp (integer) --
The time, in milliseconds from the start of the video, that the person's path was tracked. Note that Timestamp is not guaranteed to be accurate to the individual frame where the person's path first appears.
Person (dict) --
Details about a person whose path was tracked in a video.
Index (integer) --
Identifier for the person detected person within a video. Use to keep track of the person throughout the video. The identifier is not stored by Amazon Rekognition.
BoundingBox (dict) --
Bounding box around the detected person.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
Face (dict) --
Face details for the detected person.
BoundingBox (dict) --
Bounding box of the face. Default attribute.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
AgeRange (dict) --
The estimated age range, in years, for the face. Low represents the lowest estimated age and High represents the highest estimated age.
Low (integer) --
The lowest estimated age.
High (integer) --
The highest estimated age.
Smile (dict) --
Indicates whether or not the face is smiling, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is smiling or not.
Confidence (float) --
Level of confidence in the determination.
Eyeglasses (dict) --
Indicates whether or not the face is wearing eye glasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing eye glasses or not.
Confidence (float) --
Level of confidence in the determination.
Sunglasses (dict) --
Indicates whether or not the face is wearing sunglasses, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face is wearing sunglasses or not.
Confidence (float) --
Level of confidence in the determination.
Gender (dict) --
The predicted gender of a detected face.
Value (string) --
The predicted gender of the face.
Confidence (float) --
Level of confidence in the prediction.
Beard (dict) --
Indicates whether or not the face has a beard, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has beard or not.
Confidence (float) --
Level of confidence in the determination.
Mustache (dict) --
Indicates whether or not the face has a mustache, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the face has mustache or not.
Confidence (float) --
Level of confidence in the determination.
EyesOpen (dict) --
Indicates whether or not the eyes on the face are open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the eyes on the face are open.
Confidence (float) --
Level of confidence in the determination.
MouthOpen (dict) --
Indicates whether or not the mouth on the face is open, and the confidence level in the determination.
Value (boolean) --
Boolean value that indicates whether the mouth on the face is open or not.
Confidence (float) --
Level of confidence in the determination.
Emotions (list) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
(dict) --
The emotions that appear to be expressed on the face, and the confidence level in the determination. The API is only making a determination of the physical appearance of a person's face. It is not a determination of the person’s internal emotional state and should not be used in such a way. For example, a person pretending to have a sad face might not be sad emotionally.
Type (string) --
Type of emotion detected.
Confidence (float) --
Level of confidence in the determination.
Landmarks (list) --
Indicates the location of landmarks on the face. Default attribute.
(dict) --
Indicates the location of the landmark on the face.
Type (string) --
Type of landmark.
X (float) --
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.
Y (float) --
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.
Pose (dict) --
Indicates the pose of the face as determined by its pitch, roll, and yaw. Default attribute.
Roll (float) --
Value representing the face rotation on the roll axis.
Yaw (float) --
Value representing the face rotation on the yaw axis.
Pitch (float) --
Value representing the face rotation on the pitch axis.
Quality (dict) --
Identifies image brightness and sharpness. Default attribute.
Brightness (float) --
Value representing brightness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a brighter face image.
Sharpness (float) --
Value representing sharpness of the face. The service returns a value between 0 and 100 (inclusive). A higher value indicates a sharper face image.
Confidence (float) --
Confidence level that the bounding box contains a face (and not a different object such as a tree). Default attribute.
JobId (string) --
Job identifier for the person tracking operation for which you want to obtain results. The job identifer is returned by an initial call to StartPersonTracking.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartCelebrityRecognition and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the segment detection results of a Amazon Rekognition Video analysis started by StartSegmentDetection .
Segment detection with Amazon Rekognition Video is an asynchronous operation. You start segment detection by calling StartSegmentDetection which returns a job identifier (JobId ). When the segment detection operation finishes, Amazon Rekognition publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartSegmentDetection . To get the results of the segment detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . if so, call GetSegmentDetection and pass the job identifier (JobId ) from the initial call of StartSegmentDetection .
GetSegmentDetection returns detected segments in an array (Segments ) of SegmentDetection objects. Segments is sorted by the segment types specified in the SegmentTypes input parameter of StartSegmentDetection . Each element of the array includes the detected segment, the precentage confidence in the acuracy of the detected segment, the type of the segment, and the frame in which the segment was detected.
Use SelectedSegmentTypes to find out the type of segment detection requested in the call to StartSegmentDetection .
Use the MaxResults parameter to limit the number of segment detections returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetSegmentDetection and populate the NextToken request parameter with the token value returned from the previous call to GetSegmentDetection .
For more information, see Detecting video segments in stored video in the Amazon Rekognition Developer Guide.
See also: AWS API Documentation
Request Syntax
client.get_segment_detection( JobId='string', MaxResults=123, NextToken='string' )
string
[REQUIRED]
Job identifier for the text detection operation for which you want results returned. You get the job identifer from an initial call to StartSegmentDetection .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000.
string
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of text.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': [ { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, ], 'AudioMetadata': [ { 'Codec': 'string', 'DurationMillis': 123, 'SampleRate': 123, 'NumberOfChannels': 123 }, ], 'NextToken': 'string', 'Segments': [ { 'Type': 'TECHNICAL_CUE'|'SHOT', 'StartTimestampMillis': 123, 'EndTimestampMillis': 123, 'DurationMillis': 123, 'StartTimecodeSMPTE': 'string', 'EndTimecodeSMPTE': 'string', 'DurationSMPTE': 'string', 'TechnicalCueSegment': { 'Type': 'ColorBars'|'EndCredits'|'BlackFrames'|'OpeningCredits'|'StudioLogo'|'Slate'|'Content', 'Confidence': ... }, 'ShotSegment': { 'Index': 123, 'Confidence': ... }, 'StartFrameNumber': 123, 'EndFrameNumber': 123, 'DurationFrames': 123 }, ], 'SelectedSegmentTypes': [ { 'Type': 'TECHNICAL_CUE'|'SHOT', 'ModelVersion': 'string' }, ], 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
Current status of the segment detection job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (list) --
Currently, Amazon Rekognition Video returns a single object in the VideoMetadata array. The object contains information about the video stream in the input file that Amazon Rekognition Video chose to analyze. The VideoMetadata object includes the video codec, video format and other information. Video metadata is returned in each page of information returned by GetSegmentDetection .
(dict) --
Information about a video that Amazon Rekognition analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
AudioMetadata (list) --
An array of objects. There can be multiple audio streams. Each AudioMetadata object contains metadata for a single audio stream. Audio information in an AudioMetadata objects includes the audio codec, the number of audio channels, the duration of the audio stream, and the sample rate. Audio metadata is returned in each page of information returned by GetSegmentDetection .
(dict) --
Metadata information about an audio stream. An array of AudioMetadata objects for the audio streams found in a stored video is returned by GetSegmentDetection .
Codec (string) --
The audio codec used to encode or decode the audio stream.
DurationMillis (integer) --
The duration of the audio stream in milliseconds.
SampleRate (integer) --
The sample rate for the audio stream.
NumberOfChannels (integer) --
The number of audio channels in the segment.
NextToken (string) --
If the previous response was incomplete (because there are more labels to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of text.
Segments (list) --
An array of segments detected in a video. The array is sorted by the segment types (TECHNICAL_CUE or SHOT) specified in the SegmentTypes input parameter of StartSegmentDetection . Within each segment type the array is sorted by timestamp values.
(dict) --
A technical cue or shot detection segment detected in a video. An array of SegmentDetection objects containing all segments detected in a stored video is returned by GetSegmentDetection .
Type (string) --
The type of the segment. Valid values are TECHNICAL_CUE and SHOT .
StartTimestampMillis (integer) --
The start time of the detected segment in milliseconds from the start of the video. This value is rounded down. For example, if the actual timestamp is 100.6667 milliseconds, Amazon Rekognition Video returns a value of 100 millis.
EndTimestampMillis (integer) --
The end time of the detected segment, in milliseconds, from the start of the video. This value is rounded down.
DurationMillis (integer) --
The duration of the detected segment in milliseconds.
StartTimecodeSMPTE (string) --
The frame-accurate SMPTE timecode, from the start of a video, for the start of a detected segment. StartTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates).
EndTimecodeSMPTE (string) --
The frame-accurate SMPTE timecode, from the start of a video, for the end of a detected segment. EndTimecode is in HH:MM:SS:fr format (and ;fr for drop frame-rates).
DurationSMPTE (string) --
The duration of the timecode for the detected segment in SMPTE format.
TechnicalCueSegment (dict) --
If the segment is a technical cue, contains information about the technical cue.
Type (string) --
The type of the technical cue.
Confidence (float) --
The confidence that Amazon Rekognition Video has in the accuracy of the detected segment.
ShotSegment (dict) --
If the segment is a shot detection, contains information about the shot detection.
Index (integer) --
An Identifier for a shot detection segment detected in a video.
Confidence (float) --
The confidence that Amazon Rekognition Video has in the accuracy of the detected segment.
StartFrameNumber (integer) --
The frame number of the start of a video segment, using a frame index that starts with 0.
EndFrameNumber (integer) --
The frame number at the end of a video segment, using a frame index that starts with 0.
DurationFrames (integer) --
The duration of a video segment, expressed in frames.
SelectedSegmentTypes (list) --
An array containing the segment types requested in the call to StartSegmentDetection .
(dict) --
Information about the type of a segment requested in a call to StartSegmentDetection . An array of SegmentTypeInfo objects is returned by the response from GetSegmentDetection .
Type (string) --
The type of a segment (technical cue or shot detection).
ModelVersion (string) --
The version of the model used to detect segments.
JobId (string) --
Job identifier for the segment detection operation for which you want to obtain results. The job identifer is returned by an initial call to StartSegmentDetection.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartSegmentDetection and returned in the job completion notification sent to your Amazon Simple Notification Service topic.
{'JobId': 'string', 'JobTag': 'string', 'Video': {'S3Object': {'Bucket': 'string', 'Name': 'string', 'Version': 'string'}}}
Gets the text detection results of a Amazon Rekognition Video analysis started by StartTextDetection .
Text detection with Amazon Rekognition Video is an asynchronous operation. You start text detection by calling StartTextDetection which returns a job identifier (JobId ) When the text detection operation finishes, Amazon Rekognition publishes a completion status to the Amazon Simple Notification Service topic registered in the initial call to StartTextDetection . To get the results of the text detection operation, first check that the status value published to the Amazon SNS topic is SUCCEEDED . if so, call GetTextDetection and pass the job identifier (JobId ) from the initial call of StartLabelDetection .
GetTextDetection returns an array of detected text (TextDetections ) sorted by the time the text was detected, up to 50 words per frame of video.
Each element of the array includes the detected text, the precentage confidence in the acuracy of the detected text, the time the text was detected, bounding box information for where the text was located, and unique identifiers for words and their lines.
Use MaxResults parameter to limit the number of text detections returned. If there are more results than specified in MaxResults , the value of NextToken in the operation response contains a pagination token for getting the next set of results. To get the next page of results, call GetTextDetection and populate the NextToken request parameter with the token value returned from the previous call to GetTextDetection .
See also: AWS API Documentation
Request Syntax
client.get_text_detection( JobId='string', MaxResults=123, NextToken='string' )
string
[REQUIRED]
Job identifier for the text detection operation for which you want results returned. You get the job identifer from an initial call to StartTextDetection .
integer
Maximum number of results to return per paginated call. The largest value you can specify is 1000.
string
If the previous response was incomplete (because there are more labels to retrieve), Amazon Rekognition Video returns a pagination token in the response. You can use this pagination token to retrieve the next set of text.
dict
Response Syntax
{ 'JobStatus': 'IN_PROGRESS'|'SUCCEEDED'|'FAILED', 'StatusMessage': 'string', 'VideoMetadata': { 'Codec': 'string', 'DurationMillis': 123, 'Format': 'string', 'FrameRate': ..., 'FrameHeight': 123, 'FrameWidth': 123, 'ColorRange': 'FULL'|'LIMITED' }, 'TextDetections': [ { 'Timestamp': 123, 'TextDetection': { 'DetectedText': 'string', 'Type': 'LINE'|'WORD', 'Id': 123, 'ParentId': 123, 'Confidence': ..., 'Geometry': { 'BoundingBox': { 'Width': ..., 'Height': ..., 'Left': ..., 'Top': ... }, 'Polygon': [ { 'X': ..., 'Y': ... }, ] } } }, ], 'NextToken': 'string', 'TextModelVersion': 'string', 'JobId': 'string', 'Video': { 'S3Object': { 'Bucket': 'string', 'Name': 'string', 'Version': 'string' } }, 'JobTag': 'string' }
Response Structure
(dict) --
JobStatus (string) --
Current status of the text detection job.
StatusMessage (string) --
If the job fails, StatusMessage provides a descriptive error message.
VideoMetadata (dict) --
Information about a video that Amazon Rekognition analyzed. Videometadata is returned in every page of paginated responses from a Amazon Rekognition video operation.
Codec (string) --
Type of compression used in the analyzed video.
DurationMillis (integer) --
Length of the video in milliseconds.
Format (string) --
Format of the analyzed video. Possible values are MP4, MOV and AVI.
FrameRate (float) --
Number of frames per second in the video.
FrameHeight (integer) --
Vertical pixel dimension of the video.
FrameWidth (integer) --
Horizontal pixel dimension of the video.
ColorRange (string) --
A description of the range of luminance values in a video, either LIMITED (16 to 235) or FULL (0 to 255).
TextDetections (list) --
An array of text detected in the video. Each element contains the detected text, the time in milliseconds from the start of the video that the text was detected, and where it was detected on the screen.
(dict) --
Information about text detected in a video. Incudes the detected text, the time in milliseconds from the start of the video that the text was detected, and where it was detected on the screen.
Timestamp (integer) --
The time, in milliseconds from the start of the video, that the text was detected. Note that Timestamp is not guaranteed to be accurate to the individual frame where the text first appears.
TextDetection (dict) --
Details about text detected in a video.
DetectedText (string) --
The word or line of text recognized by Amazon Rekognition.
Type (string) --
The type of text that was detected.
Id (integer) --
The identifier for the detected text. The identifier is only unique for a single call to DetectText .
ParentId (integer) --
The Parent identifier for the detected text identified by the value of ID . If the type of detected text is LINE , the value of ParentId is Null .
Confidence (float) --
The confidence that Amazon Rekognition has in the accuracy of the detected text and the accuracy of the geometry points around the detected text.
Geometry (dict) --
The location of the detected text on the image. Includes an axis aligned coarse bounding box surrounding the text and a finer grain polygon for more accurate spatial information.
BoundingBox (dict) --
An axis-aligned coarse representation of the detected item's location on the image.
Width (float) --
Width of the bounding box as a ratio of the overall image width.
Height (float) --
Height of the bounding box as a ratio of the overall image height.
Left (float) --
Left coordinate of the bounding box as a ratio of overall image width.
Top (float) --
Top coordinate of the bounding box as a ratio of overall image height.
Polygon (list) --
Within the bounding box, a fine-grained polygon around the detected item.
(dict) --
The X and Y coordinates of a point on an image or video frame. The X and Y values are ratios of the overall image size or video resolution. For example, if an input image is 700x200 and the values are X=0.5 and Y=0.25, then the point is at the (350,50) pixel coordinate on the image.
An array of Point objects makes up a Polygon . A Polygon is returned by DetectText and by DetectCustomLabels Polygon represents a fine-grained polygon around a detected item. For more information, see Geometry in the Amazon Rekognition Developer Guide.
X (float) --
The value of the X coordinate for a point on a Polygon .
Y (float) --
The value of the Y coordinate for a point on a Polygon .
NextToken (string) --
If the response is truncated, Amazon Rekognition Video returns this token that you can use in the subsequent request to retrieve the next set of text.
TextModelVersion (string) --
Version number of the text detection model that was used to detect text.
JobId (string) --
Job identifier for the text detection operation for which you want to obtain results. The job identifer is returned by an initial call to StartTextDetection.
Video (dict) --
Video file stored in an Amazon S3 bucket. Amazon Rekognition video start operations such as StartLabelDetection use Video to specify a video for analysis. The supported file formats are .mp4, .mov and .avi.
S3Object (dict) --
The Amazon S3 bucket name and file name for the video.
Bucket (string) --
Name of the S3 bucket.
Name (string) --
S3 object key name.
Version (string) --
If the bucket is versioning enabled, you can specify the object version.
JobTag (string) --
A job identifier specified in the call to StartTextDetection and returned in the job completion notification sent to your Amazon Simple Notification Service topic.