Copying an Amazon Rekognition Custom Labels model (SDK) - Rekognition

Copying an Amazon Rekognition Custom Labels model (SDK)

You can use the CopyProjectVersion operation to copy an Amazon Rekognition Custom Labels model version from a source Amazon Rekognition Custom Labels project to a destination project. The destination project can be in a different AWS account, or in the same AWS account. A typical scenario is copying a tested model from a development AWS account to a production AWS account.

Alternatively, you can train the model in the destination account with the source dataset. Using the CopyProjectVersion operation has the following advantages.

  • Model behavior is consistent. Model training is non-deterministic and two models trained with same dataset aren't guaranteed to make the same predictions. Copying the model with CopyProjectVersion helps make sure that the behavior of the copied model is consistent with the source model and you won't need to re-test the model.

  • Model training isn't required. This saves you money as you are charged for each successful training of a model.

To copy a model to a different AWS account, you must have an Amazon Rekognition Custom Labels project in the destination AWS account. For information about creating a project, see Creating a project. Be sure to create the project in the destination AWS account.

A project policy is a resource-based policy that sets copy permissions for the model version that you want to copy. You will need to use a project policy when the destination project is in a different AWS account from the source project.

You do not need to use a project policy, when copying model versions within the same account. However, you can choose to use a project policy on inter-account projects if you would like more control over these resources.

You attach the project policy to the source project by calling the PutProjectPolicy operation.

You can't use CopyProjectVersion to copy a model to a project in a different AWS Region. Also, you can't copy a model with the Amazon Rekognition Custom Labels console. In these cases, you can train the model in the destination project with the datasets used to train the source model. For more information, see Training an Amazon Rekognition Custom Labels model.

To copy a model from a source project to a destination project, do the following:

To remove a project policy from a project, call DeleteProjectPolicy. To get a list of project policies attached to a project, call ListProjectPolicies.