Amazon Lookout for Vision

2020/12/01 - Amazon Lookout for Vision - 16 new api methods

Changes  This release introduces support for Amazon Lookout for Vision.

DescribeModel (new) Link ¶

Describes a version of an Amazon Lookout for Vision model.

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'
    }
}

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 contain the manifest file.

          • Prefix (string) --

            The path and name of the manifest file with the S3 bucket.

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

DeleteProject (new) Link ¶

Deletes an Amazon Lookout for Vision project.

To delete a project, you must first delete each version of the model associated with the project. To delete a model use the DeleteModel operation.

The training and test datasets are deleted automatically for you. The images referenced by the training and test datasets aren't deleted.

See also: AWS API Documentation

Request Syntax

client.delete_project(
    ProjectName='string',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project to delete.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to DeleteProject completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from DeleteProject . In this case, safely retry your call to DeleteProject by using the same ClientToken parameter value. 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 DeleteProject . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'ProjectArn': 'string'
}

Response Structure

  • (dict) --

    • ProjectArn (string) --

      The Amazon Resource Name (ARN) of the project that was deleted.

ListProjects (new) Link ¶

Lists the Amazon Lookout for Vision projects in your AWS account.

See also: AWS API Documentation

Request Syntax

client.list_projects(
    NextToken='string',
    MaxResults=123
)
type NextToken

string

param NextToken

If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for Vision returns a pagination token in the response. You can use this pagination token to retrieve the next set of projects.

type MaxResults

integer

param MaxResults

The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.

rtype

dict

returns

Response Syntax

{
    'Projects': [
        {
            'ProjectArn': 'string',
            'ProjectName': 'string',
            'CreationTimestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Projects (list) --

      A list of projects in your AWS account.

      • (dict) --

        Metadata about an Amazon Lookout for Vision project.

        • ProjectArn (string) --

          The Amazon Resource Name (ARN) of the project.

        • ProjectName (string) --

          The name of the project.

        • CreationTimestamp (datetime) --

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

    • NextToken (string) --

      If the response is truncated, Amazon Lookout for Vision returns this token that you can use in the subsequent request to retrieve the next set of projects.

CreateModel (new) Link ¶

Creates a new version of a model within an an Amazon Lookout for Vision project. CreateModel is an asynchronous operation in which Amazon Lookout for Vision trains, tests, and evaluates a new version of a model.

To get the current status, check the Status field returned in the response from DescribeModel.

If the project has a single dataset, Amazon Lookout for Vision internally splits the dataset to create a training and a test dataset. If the project has a training and a test dataset, Lookout for Vision uses the respective datasets to train and test the model.

After training completes, the evaluation metrics are stored at the location specified in OutputConfig .

See also: AWS API Documentation

Request Syntax

client.create_model(
    ProjectName='string',
    Description={
        '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'
    },
    ClientToken='string',
    OutputConfig={
        'S3Location': {
            'Bucket': 'string',
            'Prefix': 'string'
        }
    },
    KmsKeyId='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project in which you want to create a model version.

type Description

dict

param Description

A description for the version 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) -- [REQUIRED]

      The S3 location for the output.

      • Bucket (string) -- [REQUIRED]

        The S3 bucket that contain the manifest file.

      • Prefix (string) --

        The path and name of the manifest file with the S3 bucket.

  • 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) -- [REQUIRED]

      The bucket that contains the training output.

    • Key (string) -- [REQUIRED]

      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) -- [REQUIRED]

      The bucket that contains the training output.

    • Key (string) -- [REQUIRED]

      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.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to CreateModel completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from CreateModel . In this case, safely retry your call to CreateModel by using the same ClientToken parameter value. 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 CreateModel . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

type OutputConfig

dict

param OutputConfig

[REQUIRED]

The location where Amazon Lookout for Vision saves the training results.

  • S3Location (dict) -- [REQUIRED]

    The S3 location for the output.

    • Bucket (string) -- [REQUIRED]

      The S3 bucket that contain the manifest file.

    • Prefix (string) --

      The path and name of the manifest file with the S3 bucket.

type KmsKeyId

string

param KmsKeyId

The identifier of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use for encypting the model. If this parameter is not specified, the model is encrypted by a key that AWS owns and manages.

rtype

dict

returns

Response Syntax

{
    'ModelMetadata': {
        'CreationTimestamp': datetime(2015, 1, 1),
        'ModelVersion': 'string',
        'ModelArn': 'string',
        'Description': 'string',
        'Status': 'TRAINING'|'TRAINED'|'TRAINING_FAILED'|'STARTING_HOSTING'|'HOSTED'|'HOSTING_FAILED'|'STOPPING_HOSTING'|'SYSTEM_UPDATING'|'DELETING',
        'StatusMessage': 'string',
        'Performance': {
            'F1Score': ...,
            'Recall': ...,
            'Precision': ...
        }
    }
}

Response Structure

  • (dict) --

    • ModelMetadata (dict) --

      The response from a call to CreateModel .

      • CreationTimestamp (datetime) --

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

      • ModelVersion (string) --

        The version of the model.

      • ModelArn (string) --

        The Amazon Resource Name (ARN) of the model.

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

StopModel (new) Link ¶

Stops a running model. The operation might take a while to complete. To check the current status, call DescribeModel.

See also: AWS API Documentation

Request Syntax

client.stop_model(
    ProjectName='string',
    ModelVersion='string',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

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

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model that you want to stop.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to StopModel completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from StopModel . In this case, safely retry your call to StopModel by using the same ClientToken parameter value. 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 StopModel . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'Status': 'RUNNING'|'STARTING'|'STOPPED'|'FAILED'
}

Response Structure

  • (dict) --

    • Status (string) --

      The status of the model.

DescribeDataset (new) Link ¶

Describe an Amazon Lookout for Vision dataset.

See also: AWS API Documentation

Request Syntax

client.describe_dataset(
    ProjectName='string',
    DatasetType='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that contains the dataset that you want to describe.

type DatasetType

string

param DatasetType

[REQUIRED]

The type of the dataset to describe. Specify train to describe the training dataset. Specify test to describe the test dataset. If you have a single dataset project, specify train

rtype

dict

returns

Response Syntax

{
    'DatasetDescription': {
        'ProjectName': 'string',
        'DatasetType': 'string',
        'CreationTimestamp': datetime(2015, 1, 1),
        'LastUpdatedTimestamp': datetime(2015, 1, 1),
        'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED_ROLLBACK_IN_PROGRESS'|'UPDATE_FAILED_ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED',
        'StatusMessage': 'string',
        'ImageStats': {
            'Total': 123,
            'Labeled': 123,
            'Normal': 123,
            'Anomaly': 123
        }
    }
}

Response Structure

  • (dict) --

    • DatasetDescription (dict) --

      The description of the requested dataset.

      • ProjectName (string) --

        The name of the project that contains the dataset.

      • DatasetType (string) --

        The type of the dataset. The value train represents a training dataset or single dataset project. The value test represents a test dataset.

      • CreationTimestamp (datetime) --

        The Unix timestamp for the time and date that the dataset was created.

      • LastUpdatedTimestamp (datetime) --

        The Unix timestamp for the date and time that the dataset was last updated.

      • Status (string) --

        The status of the dataset.

      • StatusMessage (string) --

        The status message for the dataset.

      • ImageStats (dict) --

        • Total (integer) --

          The total number of images in the dataset.

        • Labeled (integer) --

          The total number of labeled images.

        • Normal (integer) --

          The total number of images labeled as normal.

        • Anomaly (integer) --

          the total number of images labeled as an anomaly.

StartModel (new) Link ¶

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.

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.

See also: AWS API Documentation

Request Syntax

client.start_model(
    ProjectName='string',
    ModelVersion='string',
    MinInferenceUnits=123,
    ClientToken='string'
)
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 and can support up to 5 Transaction Pers Second (TPS). 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, such as an network outage, 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. 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.

rtype

dict

returns

Response Syntax

{
    'Status': 'RUNNING'|'STARTING'|'STOPPED'|'FAILED'
}

Response Structure

  • (dict) --

    • Status (string) --

      The current running status of the model.

DeleteModel (new) Link ¶

Deletes an Amazon Lookout for Vision model. You can't delete a running model. To stop a running model, use the StopModel operation.

See also: AWS API Documentation

Request Syntax

client.delete_model(
    ProjectName='string',
    ModelVersion='string',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

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

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model that you want to delete.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to DeleteModel completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from DeleteModel . In this case, safely retry your call to DeleteModel by using the same ClientToken parameter value. 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 DeleteModel . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'ModelArn': 'string'
}

Response Structure

  • (dict) --

    • ModelArn (string) --

      The Amazon Resource Name (ARN) of the model that was deleted.

CreateProject (new) Link ¶

Creates an empty Amazon Lookout for Vision project. After you create the project, add a dataset by calling CreateDataset.

See also: AWS API Documentation

Request Syntax

client.create_project(
    ProjectName='string',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

S nsme for the project.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to CreateProject completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from CreateProject . In this case, safely retry your call to CreateProject by using the same ClientToken parameter value. 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 CreateProject . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'ProjectMetadata': {
        'ProjectArn': 'string',
        'ProjectName': 'string',
        'CreationTimestamp': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    • ProjectMetadata (dict) --

      Information about the project.

      • ProjectArn (string) --

        The Amazon Resource Name (ARN) of the project.

      • ProjectName (string) --

        The name of the project.

      • CreationTimestamp (datetime) --

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

DeleteDataset (new) Link ¶

Deletes an existing Amazon Lookout for Vision dataset .

If your the project has a single dataset, you must create a new dataset before you can create a model.

If you project has a training dataset and a test dataset consider the following.

  • If you delete the test dataset, your project reverts to a single dataset project. If you then train the model, Amazon Lookout for Vision internally splits the remaining dataset into a training and test dataset.

  • If you delete the training dataset, you must create a training dataset before you can create a model.

It might take a while to delete the dataset. To check the current status, check the Status field in the response from a call to DescribeDataset.

See also: AWS API Documentation

Request Syntax

client.delete_dataset(
    ProjectName='string',
    DatasetType='string',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that contains the dataset that you want to delete.

type DatasetType

string

param DatasetType

[REQUIRED]

The type of the dataset to delete. Specify train to delete the training dataset. Specify test to delete the test dataset. To delete the dataset in a single dataset project, specify train .

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to DeleteDataset completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from DeleteDataset . In this case, safely retry your call to DeleteDataset by using the same ClientToken parameter value. 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 DeleteDataset . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

ListDatasetEntries (new) Link ¶

Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON Line contains the anomaly information for a single image, including the image location and the assigned label.

See also: AWS API Documentation

Request Syntax

client.list_dataset_entries(
    ProjectName='string',
    DatasetType='string',
    Labeled=True|False,
    AnomalyClass='string',
    BeforeCreationDate=datetime(2015, 1, 1),
    AfterCreationDate=datetime(2015, 1, 1),
    NextToken='string',
    MaxResults=123,
    SourceRefContains='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that contains the dataset that you want to list.

type DatasetType

string

param DatasetType

[REQUIRED]

The type of the dataset that you want to list. Specify train to list the training dataset. Specify test to list the test dataset. If you have a single dataset project, specify train .

type Labeled

boolean

param Labeled

Specify true to include labeled entries, otherwise specify false . If you don't specify a value, Lookout for Vision returns all entries.

type AnomalyClass

string

param AnomalyClass

Specify normal to include only normal images. Specify anomaly to only include anomalous entries. If you don't specify a value, Amazon Lookout for Vision returns normal and anomalous images.

type BeforeCreationDate

datetime

param BeforeCreationDate

Only includes entries before the specified date in the response. For example, 2020-06-23T00:00:00 .

type AfterCreationDate

datetime

param AfterCreationDate

Only includes entries after the specified date in the response. For example, 2020-06-23T00:00:00 .

type NextToken

string

param NextToken

If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for Vision returns a pagination token in the response. You can use this pagination token to retrieve the next set of dataset entries.

type MaxResults

integer

param MaxResults

The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.

type SourceRefContains

string

param SourceRefContains

Perform a "contains" search on the values of the source-ref key within the dataset. For example a value of "IMG_17" returns all JSON Lines where the source-ref key value matches IMG_17 .

rtype

dict

returns

Response Syntax

{
    'DatasetEntries': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • DatasetEntries (list) --

      A list of the entries (JSON Lines) within the dataset.

      • (string) --

    • NextToken (string) --

      If the response is truncated, Amazon Lookout for Vision returns this token that you can use in the subsequent request to retrieve the next set ofdataset entries.

ListModels (new) Link ¶

Lists the versions of a model in an Amazon Lookout for Vision project.

See also: AWS API Documentation

Request Syntax

client.list_models(
    ProjectName='string',
    NextToken='string',
    MaxResults=123
)
type ProjectName

string

param ProjectName

[REQUIRED]

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

type NextToken

string

param NextToken

If the previous response was incomplete (because there is more data to retrieve), Amazon Lookout for Vision returns a pagination token in the response. You can use this pagination token to retrieve the next set of models.

type MaxResults

integer

param MaxResults

The maximum number of results to return per paginated call. The largest value you can specify is 100. If you specify a value greater than 100, a ValidationException error occurs. The default value is 100.

rtype

dict

returns

Response Syntax

{
    'Models': [
        {
            'CreationTimestamp': datetime(2015, 1, 1),
            'ModelVersion': 'string',
            'ModelArn': 'string',
            'Description': 'string',
            'Status': 'TRAINING'|'TRAINED'|'TRAINING_FAILED'|'STARTING_HOSTING'|'HOSTED'|'HOSTING_FAILED'|'STOPPING_HOSTING'|'SYSTEM_UPDATING'|'DELETING',
            'StatusMessage': 'string',
            'Performance': {
                'F1Score': ...,
                'Recall': ...,
                'Precision': ...
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Models (list) --

      A list of model versions in the specified project.

      • (dict) --

        Describes an Amazon Lookout for Vision model.

        • CreationTimestamp (datetime) --

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

        • ModelVersion (string) --

          The version of the model.

        • ModelArn (string) --

          The Amazon Resource Name (ARN) of the model.

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

    • NextToken (string) --

      If the response is truncated, Amazon Lookout for Vision returns this token that you can use in the subsequent request to retrieve the next set of models.

UpdateDatasetEntries (new) Link ¶

Adds one or more JSON Line entries to a dataset. A JSON Line includes information about an image used for training or testing an Amazon Lookout for Vision model. The following is an example JSON Line.

Updating a dataset might take a while to complete. To check the current status, call DescribeDataset and check the Status field in the response.

See also: AWS API Documentation

Request Syntax

client.update_dataset_entries(
    ProjectName='string',
    DatasetType='string',
    Changes=b'bytes',
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that contains the dataset that you want to update.

type DatasetType

string

param DatasetType

[REQUIRED]

The type of the dataset that you want to update. Specify train to update the training dataset. Specify test to update the test dataset. If you have a single dataset project, specify train .

type Changes

bytes

param Changes

[REQUIRED]

The entries to add to the dataset.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to UpdateDatasetEntries completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from UpdateDatasetEntries . In this case, safely retry your call to UpdateDatasetEntries by using the same ClientToken parameter value. 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 UpdateDatasetEntries . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED_ROLLBACK_IN_PROGRESS'|'UPDATE_FAILED_ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED'
}

Response Structure

  • (dict) --

    • Status (string) --

      The status of the dataset update.

DescribeProject (new) Link ¶

Describes an Amazon Lookout for Vision project.

See also: AWS API Documentation

Request Syntax

client.describe_project(
    ProjectName='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project that you want to describe.

rtype

dict

returns

Response Syntax

{
    'ProjectDescription': {
        'ProjectArn': 'string',
        'ProjectName': 'string',
        'CreationTimestamp': datetime(2015, 1, 1),
        'Datasets': [
            {
                'DatasetType': 'string',
                'CreationTimestamp': datetime(2015, 1, 1),
                'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED_ROLLBACK_IN_PROGRESS'|'UPDATE_FAILED_ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED',
                'StatusMessage': 'string'
            },
        ]
    }
}

Response Structure

  • (dict) --

    • ProjectDescription (dict) --

      The description of the project.

      • ProjectArn (string) --

        The Amazon Resource Name (ARN) of the project.

      • ProjectName (string) --

        The name of the project.

      • CreationTimestamp (datetime) --

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

      • Datasets (list) --

        A list of datasets in the project.

        • (dict) --

          Sumary information for an Amazon Lookout for Vision dataset.

          • DatasetType (string) --

            The type of the dataset.

          • CreationTimestamp (datetime) --

            The Unix timestamp for the date and time that the dataset was created.

          • Status (string) --

            The status for the dataset.

          • StatusMessage (string) --

            The status message for the dataset.

DetectAnomalies (new) Link ¶

Detects anomalies in an image that you supply.

The response from DetectAnomalies includes a boolean prediction that the image contains one or more anomalies and a confidence value for the prediction.

Note

Before calling DetectAnomalies , you must first start your model with the StartModel operation. You are charged for the amount of time, in minutes, that a model runs and for the number of anomaly detection units that your model uses. If you are not using a model, use the StopModel operation to stop your model.

See also: AWS API Documentation

Request Syntax

client.detect_anomalies(
    ProjectName='string',
    ModelVersion='string',
    Body=b'bytes'|file,
    ContentType='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

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

type ModelVersion

string

param ModelVersion

[REQUIRED]

The version of the model that you want to use.

type Body

bytes or seekable file-like object

param Body

[REQUIRED]

The unencrypted image bytes that you want to analyze.

type ContentType

string

param ContentType

[REQUIRED]

The type of the image passed in Body . Valid values are image/png (PNG format images) and image/jpeg (JPG format images).

rtype

dict

returns

Response Syntax

{
    'DetectAnomalyResult': {
        'Source': {
            'Type': 'string'
        },
        'IsAnomalous': True|False,
        'Confidence': ...
    }
}

Response Structure

  • (dict) --

    • DetectAnomalyResult (dict) --

      The results of the DetectAnomalies operation.

      • Source (dict) --

        The source of the image that was analyzed. direct means that the images was supplied from the local computer. No other values are supported.

        • Type (string) --

          The type of the image.

      • IsAnomalous (boolean) --

        True if the image contains an anomaly, otherwise false.

      • Confidence (float) --

        The confidence that Amazon Lookout for Vision has in the accuracy of the prediction.

CreateDataset (new) Link ¶

Creates a new dataset in an Amazon Lookout for Vision project. CreateDataset can create a training or a test dataset from a valid dataset source ( DatasetSource ).

If you want a single dataset project, specify train for the value of DatasetType .

To have a project with separate training and test datasets, call CreateDataset twice. On the first call, specify train for the value of DatasetType . On the second call, specify test for the value of DatasetType . of dataset with

See also: AWS API Documentation

Request Syntax

client.create_dataset(
    ProjectName='string',
    DatasetType='string',
    DatasetSource={
        'GroundTruthManifest': {
            'S3Object': {
                'Bucket': 'string',
                'Key': 'string',
                'VersionId': 'string'
            }
        }
    },
    ClientToken='string'
)
type ProjectName

string

param ProjectName

[REQUIRED]

The name of the project in which you want to create a dataset.

type DatasetType

string

param DatasetType

[REQUIRED]

The type of the dataset. Specify train for a training dataset. Specify test for a test dataset.

type DatasetSource

dict

param DatasetSource

The location of the manifest file that Amazon Lookout for Vision uses to create the dataset.

If you don't specify DatasetSource , an empty dataset is created and the operation synchronously returns. Later, you can add JSON Lines by calling UpdateDatasetEntries.

If you specify a value for DataSource , the manifest at the S3 location is validated and used to create the dataset. The call to CreateDataset is asynchronous and might take a while to complete. To find out the current status, Check the value of Status returned in a call to DescribeDataset.

  • GroundTruthManifest (dict) --

    Location information for the manifest file.

    • S3Object (dict) --

      The S3 bucket location for the manifest file.

      • Bucket (string) -- [REQUIRED]

        The Amazon S3 bucket that contains the manifest.

      • Key (string) -- [REQUIRED]

        The name and location of the manifest file withiin the bucket.

      • VersionId (string) --

        The version ID of the bucket.

type ClientToken

string

param ClientToken

ClientToken is an idempotency token that ensures a call to CreateDataset completes only once. You choose the value to pass. For example, An issue, such as an network outage, might prevent you from getting a response from CreateDataset . In this case, safely retry your call to CreateDataset by using the same ClientToken parameter value. 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 CreateDataset . An idempotency token is active for 8 hours.

This field is autopopulated if not provided.

rtype

dict

returns

Response Syntax

{
    'DatasetMetadata': {
        'DatasetType': 'string',
        'CreationTimestamp': datetime(2015, 1, 1),
        'Status': 'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'|'UPDATE_IN_PROGRESS'|'UPDATE_COMPLETE'|'UPDATE_FAILED_ROLLBACK_IN_PROGRESS'|'UPDATE_FAILED_ROLLBACK_COMPLETE'|'DELETE_IN_PROGRESS'|'DELETE_COMPLETE'|'DELETE_FAILED',
        'StatusMessage': 'string'
    }
}

Response Structure

  • (dict) --

    • DatasetMetadata (dict) --

      Information about the dataset.

      • DatasetType (string) --

        The type of the dataset.

      • CreationTimestamp (datetime) --

        The Unix timestamp for the date and time that the dataset was created.

      • Status (string) --

        The status for the dataset.

      • StatusMessage (string) --

        The status message for the dataset.