Tagging models - Amazon Lookout for Vision

Tagging models

You can identify, organize, search for, and filter your Amazon Lookout for Vision models by using tags. Each tag is a label consisting of a user-defined key and value. For example, to help determine billing for your models, you could tag your models with a Cost center key and add the appropriate cost center number as a value. For more information, see Tagging AWS resources.

Use tags to:

You can tag models by using the Amazon Lookout for Vision console or by using the AWS SDKs.

Tagging models (console)

You can use the Amazon Lookout for Vision console to add tags to models, view the tags attached to a model, and remove tags.

Adding or removing tags (console)

This procedure explains how to add tags to, or remove tags from, an existing model. You can also add tags to a new model when it is trained. For more information, see Training your model.

To add tags to, or remove tags from, an existing model (console)
  1. Open the Amazon Lookout for Vision console at https://console.aws.amazon.com/lookoutvision/.

  2. Choose Get started.

  3. In the navigation pane, choose Projects.

  4. On the Projects resources page, choose the project that contains the model that you want to tag.

  5. In the navigation pane, under the project you previously chose, choose Models.

  6. In the Models section, choose the model that you want to add a tag to.

  7. On the model's details page, choose the Tags tab.

  8. In the Tags section, choose Manage tags.

  9. On the Manage tags page, choose Add new tag.

  10. Enter a key and a value.

    1. For Key, enter a name for the key.

    2. For Value, enter a value.

  11. To add more tags, repeat steps 9 and 10.

  12. (Optional) To remove a tag, choose Remove next to the tag that you want to remove. If you are removing a previously saved tag, it is removed when you save your changes.

  13. Choose Save changes to save your changes.

Viewing model tags (console)

You can use the Amazon Lookout for Vision console to view the tags attached to a model.

To view the tags attached to all models within a project, you must use the AWS SDK. For more information, see Listing model tags (SDK).

To view the tags attached to a model
  1. Open the Amazon Lookout for Vision console at https://console.aws.amazon.com/lookoutvision/.

  2. Choose Get started.

  3. In the navigation pane, choose Projects.

  4. On the Projects resources page, choose the project that contains the model whose tag you want to view.

  5. In the navigation pane, under the project you previously chose, choose Models.

  6. In the Models section, choose the model whose tag you want to view.

  7. On the model's details page, choose the Tags tab. The tags are shown in Tags section.

Tagging models (SDK)

You can use the AWS SDK to:

  • Add tags to a new model

  • Add tags to an existing model

  • List the tags attached to a model

  • Remove tags from a model

This section includes AWS CLI examples. If you haven't installed the AWS CLI, see Step 4: Set up the AWS CLI and AWS SDKs.

Adding tags to a new model (SDK)

You can add tags to a model when you create it using the CreateModel operation. Specify one or more tags in the Tags array input parameter.

aws lookoutvision create-model --project-name "project name"\ --output-config '{ "S3Location": { "Bucket": "output bucket", "Prefix": "output folder" } }'\ --tags '[{"Key":"Key","Value":"Value"}]' \ --profile lookoutvision-access

For information about creating and training a model, see Training a model (SDK).

Adding tags to an existing model (SDK)

To add one or more tags to an existing model, use the TagResource operation. Specify the model's Amazon Resource Name (ARN) (ResourceArn) and the tags (Tags) that you want to add.

aws lookoutvision tag-resource --resource-arn "resource-arn"\ --tags '[{"Key":"Key","Value":"Value"}]' \ --profile lookoutvision-access

For example Java code, see TagModel.

Listing model tags (SDK)

To list the tags attached to a model, use the ListTagsForResource operation and specify the model's Amazon Resource Name (ARN), the (ResourceArn). The response is a map of tag keys and values that are attached to the specified model.

aws lookoutvision list-tags-for-resource --resource-arn resource-arn \ --profile lookoutvision-access

To see which models in a project have a specific tag, call ListModels to get a list of models. Then call ListTagsForResource for each model in the response from ListModels. Inspect the response from ListTagsForResource to see if the required tag is present.

For example Java code, see ListModelTags. For example Python code that searches for a tag value across all projects, see find_tag.py.

Removing tags from a model (SDK)

To remove one or more tags from a model, use the UntagResource operation. Specify the model's Amazon Resource Name (ARN) (ResourceArn) and the tag keys (Tag-Keys) that you want to remove.

aws lookoutvision untag-resource --resource-arn resource-arn\ --tag-keys '["Key"]' \ --profile lookoutvision-access

For example Java code, see UntagModel.