/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.rekognition.model; import java.io.Serializable; import com.amazonaws.AmazonWebServiceRequest; /** *
* Creates a new version of a model and begins training. Models are managed as
* part of an Amazon Rekognition Custom Labels project. The response from
* CreateProjectVersion
is an Amazon Resource Name (ARN) for the
* version of the model.
*
* Training uses the training and test datasets associated with the project. For * more information, see Creating training and test dataset in the Amazon * Rekognition Custom Labels Developer Guide. *
*
* You can train a model in a project that doesn't have associated datasets by
* specifying manifest files in the TrainingData
and
* TestingData
fields.
*
* If you open the console after training a model with manifest files, Amazon * Rekognition Custom Labels creates the datasets for you using the most recent * manifest files. You can no longer train a model version for the project by * specifying manifest files. *
** Instead of training with a project without associated datasets, we recommend * that you use the manifest files to create training and test datasets for the * project. *
*
* Training takes a while to complete. You can get the current status by calling
* DescribeProjectVersions. Training completed successfully if the value
* of the Status
field is TRAINING_COMPLETED
.
*
* If training fails, see Debugging a failed model training in the Amazon * Rekognition Custom Labels developer guide. *
** Once training has successfully completed, call DescribeProjectVersions * to get the training results and evaluate the model. For more information, see * Improving a trained Amazon Rekognition Custom Labels model in the Amazon * Rekognition Custom Labels developers guide. *
** After evaluating the model, you start the model by calling * StartProjectVersion. *
*
* This operation requires permissions to perform the
* rekognition:CreateProjectVersion
action.
*
* The ARN of the Amazon Rekognition Custom Labels project that manages the * model that you want to train. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*/
private String projectArn;
/**
*
* A name for the version of the model. This value must be unique. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*/
private String versionName;
/**
*
* The Amazon S3 bucket location to store the results of training. The S3
* bucket can be in any AWS account as long as the caller has
* s3:PutObject
permissions on the S3 bucket.
*
* Specifies an external manifest that the services uses to train the model.
* If you specify TrainingData
you must also specify
* TestingData
. The project must not have any associated
* datasets.
*
* Specifies an external manifest that the service uses to test the model.
* If you specify TestingData
you must also specify
* TrainingData
. The project must not have any associated
* datasets.
*
* A set of tags (key-value pairs) that you want to attach to the model. *
*/ private java.util.Map
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training and test images copied into the service for model
* training. Your source images are unaffected. The key is also used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (OutputConfig
).
*
* If you choose to use your own KMS key, you need the following permissions * on the KMS key. *
** kms:CreateGrant *
** kms:DescribeKey *
** kms:GenerateDataKey *
** kms:Decrypt *
*
* If you don't specify a value for KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Constraints:
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*/
private String kmsKeyId;
/**
*
* The ARN of the Amazon Rekognition Custom Labels project that manages the * model that you want to train. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @return
* The ARN of the Amazon Rekognition Custom Labels project that * manages the model that you want to train. *
*/ public String getProjectArn() { return projectArn; } /** ** The ARN of the Amazon Rekognition Custom Labels project that manages the * model that you want to train. *
*
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @param projectArn
* The ARN of the Amazon Rekognition Custom Labels project that * manages the model that you want to train. *
*/ public void setProjectArn(String projectArn) { this.projectArn = projectArn; } /** ** The ARN of the Amazon Rekognition Custom Labels project that manages the * model that you want to train. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 20 - 2048
* Pattern:
* (^arn:[a-z\d-]+:rekognition:[a-z\d-]+:\d{12}:project\/[a-zA
* -Z0-9_.\-]{1,255}\/[0-9]+$)
*
* @param projectArn
* The ARN of the Amazon Rekognition Custom Labels project that * manages the model that you want to train. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateProjectVersionRequest withProjectArn(String projectArn) { this.projectArn = projectArn; return this; } /** ** A name for the version of the model. This value must be unique. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @return
* A name for the version of the model. This value must be unique. *
*/ public String getVersionName() { return versionName; } /** ** A name for the version of the model. This value must be unique. *
*
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @param versionName
* A name for the version of the model. This value must be * unique. *
*/ public void setVersionName(String versionName) { this.versionName = versionName; } /** ** A name for the version of the model. This value must be unique. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 255
* Pattern: [a-zA-Z0-9_.\-]+
*
* @param versionName
* A name for the version of the model. This value must be * unique. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateProjectVersionRequest withVersionName(String versionName) { this.versionName = versionName; return this; } /** *
* The Amazon S3 bucket location to store the results of training. The S3
* bucket can be in any AWS account as long as the caller has
* s3:PutObject
permissions on the S3 bucket.
*
* The Amazon S3 bucket location to store the results of training.
* The S3 bucket can be in any AWS account as long as the caller has
* s3:PutObject
permissions on the S3 bucket.
*
* The Amazon S3 bucket location to store the results of training. The S3
* bucket can be in any AWS account as long as the caller has
* s3:PutObject
permissions on the S3 bucket.
*
* The Amazon S3 bucket location to store the results of
* training. The S3 bucket can be in any AWS account as long as
* the caller has s3:PutObject
permissions on the S3
* bucket.
*
* The Amazon S3 bucket location to store the results of training. The S3
* bucket can be in any AWS account as long as the caller has
* s3:PutObject
permissions on the S3 bucket.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param outputConfig
* The Amazon S3 bucket location to store the results of
* training. The S3 bucket can be in any AWS account as long as
* the caller has s3:PutObject
permissions on the S3
* bucket.
*
* Specifies an external manifest that the services uses to train the model.
* If you specify TrainingData
you must also specify
* TestingData
. The project must not have any associated
* datasets.
*
* Specifies an external manifest that the services uses to train
* the model. If you specify TrainingData
you must also
* specify TestingData
. The project must not have any
* associated datasets.
*
* Specifies an external manifest that the services uses to train the model.
* If you specify TrainingData
you must also specify
* TestingData
. The project must not have any associated
* datasets.
*
* Specifies an external manifest that the services uses to train
* the model. If you specify TrainingData
you must
* also specify TestingData
. The project must not
* have any associated datasets.
*
* Specifies an external manifest that the services uses to train the model.
* If you specify TrainingData
you must also specify
* TestingData
. The project must not have any associated
* datasets.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param trainingData
* Specifies an external manifest that the services uses to train
* the model. If you specify TrainingData
you must
* also specify TestingData
. The project must not
* have any associated datasets.
*
* Specifies an external manifest that the service uses to test the model.
* If you specify TestingData
you must also specify
* TrainingData
. The project must not have any associated
* datasets.
*
* Specifies an external manifest that the service uses to test the
* model. If you specify TestingData
you must also
* specify TrainingData
. The project must not have any
* associated datasets.
*
* Specifies an external manifest that the service uses to test the model.
* If you specify TestingData
you must also specify
* TrainingData
. The project must not have any associated
* datasets.
*
* Specifies an external manifest that the service uses to test
* the model. If you specify TestingData
you must
* also specify TrainingData
. The project must not
* have any associated datasets.
*
* Specifies an external manifest that the service uses to test the model.
* If you specify TestingData
you must also specify
* TrainingData
. The project must not have any associated
* datasets.
*
* Returns a reference to this object so that method calls can be chained * together. * * @param testingData
* Specifies an external manifest that the service uses to test
* the model. If you specify TestingData
you must
* also specify TrainingData
. The project must not
* have any associated datasets.
*
* A set of tags (key-value pairs) that you want to attach to the model. *
* * @return* A set of tags (key-value pairs) that you want to attach to the * model. *
*/ public java.util.Map* A set of tags (key-value pairs) that you want to attach to the model. *
* * @param tags* A set of tags (key-value pairs) that you want to attach to the * model. *
*/ public void setTags(java.util.Map* A set of tags (key-value pairs) that you want to attach to the model. *
** Returns a reference to this object so that method calls can be chained * together. * * @param tags
* A set of tags (key-value pairs) that you want to attach to the * model. *
* @return A reference to this updated object so that method calls can be * chained together. */ public CreateProjectVersionRequest withTags(java.util.Map* A set of tags (key-value pairs) that you want to attach to the model. *
*
* The method adds a new key-value pair into Tags parameter, and returns a
* reference to this object so that method calls can be chained together.
*
* @param key The key of the entry to be added into Tags.
* @param value The corresponding value of the entry to be added into Tags.
* @return A reference to this updated object so that method calls can be
* chained together.
*/
public CreateProjectVersionRequest addTagsEntry(String key, String value) {
if (null == this.tags) {
this.tags = new java.util.HashMap
* Returns a reference to this object so that method calls can be chained
* together.
*/
public CreateProjectVersionRequest clearTagsEntries() {
this.tags = null;
return this;
}
/**
*
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training and test images copied into the service for model
* training. Your source images are unaffected. The key is also used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Constraints:
* The identifier for your AWS Key Management Service key (AWS KMS
* key). You can supply the Amazon Resource Name (ARN) of your KMS
* key, the ID of your KMS key, an alias for your KMS key, or an
* alias ARN. The key is used to encrypt training and test images
* copied into the service for model training. Your source images
* are unaffected. The key is also used to encrypt training results
* and manifest files written to the output Amazon S3 bucket (
*
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training and test images copied into the service for model
* training. Your source images are unaffected. The key is also used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Constraints:
* The identifier for your AWS Key Management Service key (AWS
* KMS key). You can supply the Amazon Resource Name (ARN) of
* your KMS key, the ID of your KMS key, an alias for your KMS
* key, or an alias ARN. The key is used to encrypt training and
* test images copied into the service for model training. Your
* source images are unaffected. The key is also used to encrypt
* training results and manifest files written to the output
* Amazon S3 bucket (
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* The identifier for your AWS Key Management Service key (AWS KMS key). You
* can supply the Amazon Resource Name (ARN) of your KMS key, the ID of your
* KMS key, an alias for your KMS key, or an alias ARN. The key is used to
* encrypt training and test images copied into the service for model
* training. Your source images are unaffected. The key is also used to
* encrypt training results and manifest files written to the output Amazon
* S3 bucket (
* If you choose to use your own KMS key, you need the following permissions
* on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for
* Returns a reference to this object so that method calls can be chained
* together.
*
* Constraints:
* The identifier for your AWS Key Management Service key (AWS
* KMS key). You can supply the Amazon Resource Name (ARN) of
* your KMS key, the ID of your KMS key, an alias for your KMS
* key, or an alias ARN. The key is used to encrypt training and
* test images copied into the service for model training. Your
* source images are unaffected. The key is also used to encrypt
* training results and manifest files written to the output
* Amazon S3 bucket (
* If you choose to use your own KMS key, you need the following
* permissions on the KMS key.
*
* kms:CreateGrant
*
* kms:DescribeKey
*
* kms:GenerateDataKey
*
* kms:Decrypt
*
* If you don't specify a value for OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @return OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS owns
* and manages.
* OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @param kmsKeyId OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS
* owns and manages.
* OutputConfig
).
*
*
* KmsKeyId
, images copied
* into the service are encrypted using a key that AWS owns and manages.
*
* Length: 1 - 2048
* Pattern: ^[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,2048}$
*
* @param kmsKeyId OutputConfig
).
*
*
* KmsKeyId
, images
* copied into the service are encrypted using a key that AWS
* owns and manages.
*