Skip to content

distribute_dataset_entries

distribute_dataset_entries(
    datasets: DistributeDatasetMetadataList,
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> DistributeDatasetEntriesResponse

This operation applies only to Amazon Rekognition Custom Labels.

Distributes the entries (images) in a training dataset across the training dataset and the test dataset for a project. DistributeDatasetEntries moves 20% of the training dataset images to the test dataset. An entry is a JSON Line that describes an image.

You supply the Amazon Resource Names (ARN) of a project's training dataset and test dataset. The training dataset must contain the images that you want to split. The test dataset must be empty. The datasets must belong to the same project. To create training and test datasets for a project, call CreateDataset.

Distributing a dataset takes a while to complete. To check the status call DescribeDataset. The operation is complete when the Status field for the training dataset and the test dataset is UPDATE_COMPLETE. If the dataset split fails, the value of Status is UPDATE_FAILED.

This operation requires permissions to perform the rekognition:DistributeDatasetEntries action.

Parameters:

  • datasets (DistributeDatasetMetadataList) –

    The ARNS for the training dataset and test dataset that you want to use. The datasets must belong to the same project. The test dataset must be empty.

Raises:

Examples:

To distribute an Amazon Rekognition Custom Labels dataset Distributes an Amazon Rekognition Custom Labels training dataset to a test dataset.

>>> client.distribute_dataset_entries(datasets=[{'Arn': 'arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106'}, {'Arn': 'arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/test/1690564858106'}])
Source code in docs_src/capo_rekognition/_services/rekognition.py
def distribute_dataset_entries(
    self,
    datasets: "capo_rekognition.types.distribute_dataset_metadata_list.DistributeDatasetMetadataList",
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
) -> "capo_rekognition.types.distribute_dataset_entries_response.DistributeDatasetEntriesResponse":
    """<note> <p>This operation applies only to Amazon Rekognition Custom Labels.</p> </note> <p>Distributes the entries (images) in a training dataset across the training dataset and the test dataset for a project. <code>DistributeDatasetEntries</code> moves 20% of the training dataset images to the test dataset. An entry is a JSON Line that describes an image. </p> <p>You supply the Amazon Resource Names (ARN) of a project's training dataset and test dataset. The training dataset must contain the images that you want to split. The test dataset must be empty. The datasets must belong to the same project. To create training and test datasets for a project, call <a>CreateDataset</a>.</p> <p>Distributing a dataset takes a while to complete. To check the status call <code>DescribeDataset</code>. The operation is complete when the <code>Status</code> field for the training dataset and the test dataset is <code>UPDATE_COMPLETE</code>. If the dataset split fails, the value of <code>Status</code> is <code>UPDATE_FAILED</code>.</p> <p>This operation requires permissions to perform the <code>rekognition:DistributeDatasetEntries</code> action.</p>

    Args:
        datasets: <p>The ARNS for the training dataset and test dataset that you want to use. The datasets must belong to the same project. The test dataset must be empty. </p>

    Raises:
        capo_rekognition.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to perform the action.</p>
        capo_rekognition.errors.internal_server_error.InternalServerError: <p>Amazon Rekognition experienced a service issue. Try your call again.</p>
        capo_rekognition.errors.invalid_parameter_exception.InvalidParameterException: <p>Input parameter violated a constraint. Validate your parameter before calling the API operation again.</p>
        capo_rekognition.errors.provisioned_throughput_exceeded_exception.ProvisionedThroughputExceededException: <p>The number of requests exceeded your throughput limit. If you want to increase this limit, contact Amazon Rekognition.</p>
        capo_rekognition.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request cannot be found.</p>
        capo_rekognition.errors.resource_not_ready_exception.ResourceNotReadyException: <p>The requested resource isn't ready. For example, this exception occurs when you call <code>DetectCustomLabels</code> with a model version that isn't deployed. </p>
        capo_rekognition.errors.throttling_exception.ThrottlingException: <p>Amazon Rekognition is temporarily unable to process the request. Try your call again.</p>
        capo_rekognition.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To distribute an Amazon Rekognition Custom Labels dataset
        Distributes an Amazon Rekognition Custom Labels training dataset to a test dataset.

        >>> client.distribute_dataset_entries(datasets=[{'Arn': 'arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106'}, {'Arn': 'arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/test/1690564858106'}])
    """

    def _handler(
        req: "OperationRequest[capo_rekognition.types.distribute_dataset_entries_request.DistributeDatasetEntriesRequest]",
    ) -> OperationResponse[
        "capo_rekognition.types.distribute_dataset_entries_response.DistributeDatasetEntriesResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.distribute_dataset_entries

        output, http_response = (
            capo_rekognition._operations.rekognition_service.distribute_dataset_entries.distribute_dataset_entries(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DistributeDatasetEntries")
    )
    input_: capo_rekognition.types.distribute_dataset_entries_request.DistributeDatasetEntriesRequest = {
        "datasets": datasets
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output