Amazon Lookout for Vision

2022/07/26 - Amazon Lookout for Vision - 2 updated api methods

Changes  This release introduces support for the automatic scaling of inference units used by Amazon Lookout for Vision models.

DescribeModel (updated) Link ¶
Changes (response)
{'ModelDescription': {'MaxInferenceUnits': 'integer',
                      'MinInferenceUnits': 'integer'}}

Describes a version of an Amazon Lookout for Vision model.

This operation requires permissions to perform the lookoutvision:DescribeModel operation.

See also: AWS API Documentation

Request Syntax

client.describe_model(
    ProjectName='string',
    ModelVersion='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The project that contains the version of a model that you want to describe.

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model that you want to describe.

rtype

dict

returns

Response Syntax

{
    'ModelDescription': {
        'ModelVersion': 'string',
        'ModelArn': 'string',
        'CreationTimestamp': datetime(2015, 1, 1),
        'Description': 'string',
        'Status': 'TRAINING'|'TRAINED'|'TRAINING_FAILED'|'STARTING_HOSTING'|'HOSTED'|'HOSTING_FAILED'|'STOPPING_HOSTING'|'SYSTEM_UPDATING'|'DELETING',
        'StatusMessage': 'string',
        'Performance': {
            'F1Score': ...,
            'Recall': ...,
            'Precision': ...
        },
        'OutputConfig': {
            'S3Location': {
                'Bucket': 'string',
                'Prefix': 'string'
            }
        },
        'EvaluationManifest': {
            'Bucket': 'string',
            'Key': 'string'
        },
        'EvaluationResult': {
            'Bucket': 'string',
            'Key': 'string'
        },
        'EvaluationEndTimestamp': datetime(2015, 1, 1),
        'KmsKeyId': 'string',
        'MinInferenceUnits': 123,
        'MaxInferenceUnits': 123
    }
}

Response Structure

  • (dict) --

    • ModelDescription (dict) --

      Contains the description of the model.

      • ModelVersion (string) --

        The version of the model

      • ModelArn (string) --

        The Amazon Resource Name (ARN) of the model.

      • CreationTimestamp (datetime) --

        The unix timestamp for the date and time that the model was created.

      • Description (string) --

        The description for the model.

      • Status (string) --

        The status of the model.

      • StatusMessage (string) --

        The status message for the model.

      • Performance (dict) --

        Performance metrics for the model. Created during training.

        • F1Score (float) --

          The overall F1 score metric for the trained model.

        • Recall (float) --

          The overall recall metric value for the trained model.

        • Precision (float) --

          The overall precision metric value for the trained model.

      • OutputConfig (dict) --

        The S3 location where Amazon Lookout for Vision saves model training files.

        • S3Location (dict) --

          The S3 location for the output.

          • Bucket (string) --

            The S3 bucket that contains the training or model packaging job output. If you are training a model, the bucket must in your AWS account. If you use an S3 bucket for a model packaging job, the S3 bucket must be in the same AWS Region and AWS account in which you use AWS IoT Greengrass.

          • Prefix (string) --

            The path of the folder, within the S3 bucket, that contains the output.

      • EvaluationManifest (dict) --

        The S3 location where Amazon Lookout for Vision saves the manifest file that was used to test the trained model and generate the performance scores.

        • Bucket (string) --

          The bucket that contains the training output.

        • Key (string) --

          The location of the training output in the bucket.

      • EvaluationResult (dict) --

        The S3 location where Amazon Lookout for Vision saves the performance metrics.

        • Bucket (string) --

          The bucket that contains the training output.

        • Key (string) --

          The location of the training output in the bucket.

      • EvaluationEndTimestamp (datetime) --

        The unix timestamp for the date and time that the evaluation ended.

      • KmsKeyId (string) --

        The identifer for the AWS Key Management Service (AWS KMS) key that was used to encrypt the model during training.

      • MinInferenceUnits (integer) --

        The minimum number of inference units used by the model. For more information, see StartModel

      • MaxInferenceUnits (integer) --

        The maximum number of inference units Amazon Lookout for Vision uses to auto-scale the model. For more information, see StartModel.

StartModel (updated) Link ¶
Changes (request)
{'MaxInferenceUnits': 'integer'}

Starts the running of the version of an Amazon Lookout for Vision model. Starting a model takes a while to complete. To check the current state of the model, use DescribeModel.

A model is ready to use when its status is HOSTED .

Once the model is running, you can detect custom labels in new images by calling DetectAnomalies.

Note

You are charged for the amount of time that the model is running. To stop a running model, call StopModel.

This operation requires permissions to perform the lookoutvision:StartModel operation.

See also: AWS API Documentation

Request Syntax

client.start_model(
    ProjectName='string',
    ModelVersion='string',
    MinInferenceUnits=123,
    ClientToken='string',
    MaxInferenceUnits=123
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that contains the model that you want to start.

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model that you want to start.

type MinInferenceUnits

integer

param MinInferenceUnits

[REQUIRED]

The minimum number of inference units to use. A single inference unit represents 1 hour of processing. Use a higher number to increase the TPS throughput of your model. You are charged for the number of inference units that you use.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to StartModel completes only once. You choose the value to pass. For example, An issue might prevent you from getting a response from StartModel . In this case, safely retry your call to StartModel by using the same ClientToken parameter value.

If you don't supply a value for ClientToken , the AWS SDK you are using inserts a value for you. This prevents retries after a network error from making multiple start requests. You'll need to provide your own value for other use cases.

An error occurs if the other input parameters are not the same as in the first request. Using a different value for ClientToken is considered a new call to StartModel . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

type MaxInferenceUnits

integer

param MaxInferenceUnits

The maximum number of inference units to use for auto-scaling the model. If you don't specify a value, Amazon Lookout for Vision doesn't auto-scale the model.

rtype

dict

returns

Response Syntax

{
    'Status': 'STARTING_HOSTING'|'HOSTED'|'HOSTING_FAILED'|'STOPPING_HOSTING'|'SYSTEM_UPDATING'
}

Response Structure

  • (dict) --

    • Status (string) --

      The current running status of the model.