Rekognition / Client / start_media_analysis_job

start_media_analysis_job#

Rekognition.Client.start_media_analysis_job(**kwargs)#

Initiates a new media analysis job. Accepts a manifest file in an Amazon S3 bucket. The output is a manifest file and a summary of the manifest stored in the Amazon S3 bucket.

See also: AWS API Documentation

Request Syntax

response = client.start_media_analysis_job(
    ClientRequestToken='string',
    JobName='string',
    OperationsConfig={
        'DetectModerationLabels': {
            'MinConfidence': ...,
            'ProjectVersion': 'string'
        }
    },
    Input={
        'S3Object': {
            'Bucket': 'string',
            'Name': 'string',
            'Version': 'string'
        }
    },
    OutputConfig={
        'S3Bucket': 'string',
        'S3KeyPrefix': 'string'
    },
    KmsKeyId='string'
)
Parameters:
  • ClientRequestToken (string) –

    Idempotency token used to prevent the accidental creation of duplicate versions. If you use the same token with multiple StartMediaAnalysisJobRequest requests, the same response is returned. Use ClientRequestToken to prevent the same request from being processed more than once.

    This field is autopopulated if not provided.

  • JobName (string) – The name of the job. Does not have to be unique.

  • OperationsConfig (dict) –

    [REQUIRED]

    Configuration options for the media analysis job to be created.

    • DetectModerationLabels (dict) –

      Contains configuration options for a DetectModerationLabels job.

      • MinConfidence (float) –

        Specifies the minimum confidence level for the moderation labels to return. Amazon Rekognition doesn’t return any labels with a confidence level lower than this specified value.

      • ProjectVersion (string) –

        Specifies the custom moderation model to be used during the label detection job. If not provided the pre-trained model is used.

  • Input (dict) –

    [REQUIRED]

    Input data to be analyzed by the job.

    • S3Object (dict) – [REQUIRED]

      Provides the S3 bucket name and object name.

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

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

      • 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.

  • OutputConfig (dict) –

    [REQUIRED]

    The Amazon S3 bucket location to store the results.

    • S3Bucket (string) – [REQUIRED]

      Specifies the Amazon S3 bucket to contain the output of the media analysis job.

    • S3KeyPrefix (string) –

      Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for storage.

  • KmsKeyId (string) – The identifier of customer managed AWS KMS key (name or ARN). The key is used to encrypt images copied into the service. The key is also used to encrypt results and manifest files written to the output Amazon S3 bucket.

Return type:

dict

Returns:

Response Syntax

{
    'JobId': 'string'
}

Response Structure

  • (dict) –

    • JobId (string) –

      Identifier for the created job.

Exceptions

  • Rekognition.Client.exceptions.InternalServerError

  • Rekognition.Client.exceptions.AccessDeniedException

  • Rekognition.Client.exceptions.InvalidParameterException

  • Rekognition.Client.exceptions.InvalidManifestException

  • Rekognition.Client.exceptions.InvalidS3ObjectException

  • Rekognition.Client.exceptions.ResourceNotFoundException

  • Rekognition.Client.exceptions.ResourceNotReadyException

  • Rekognition.Client.exceptions.ProvisionedThroughputExceededException

  • Rekognition.Client.exceptions.LimitExceededException

  • Rekognition.Client.exceptions.ThrottlingException

  • Rekognition.Client.exceptions.IdempotentParameterMismatchException