Skip to content

list_dataset_entries

list_dataset_entries(
    dataset_arn: DatasetArn,
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
    contains_labels: Optional[DatasetLabels] = None,
    labeled: Optional[IsLabeled] = None,
    source_ref_contains: Optional[QueryString] = None,
    has_errors: Optional[HasErrors] = None,
    next_token: Optional[ExtendedPaginationToken] = None,
    max_results: Optional[ListDatasetEntriesPageSize] = None,
) -> ListDatasetEntriesResponse

This operation applies only to Amazon Rekognition Custom Labels.

Lists the entries (images) within a dataset. An entry is a JSON Line that contains the information for a single image, including the image location, assigned labels, and object location bounding boxes. For more information, see Creating a manifest file.

JSON Lines in the response include information about non-terminal errors found in the dataset. Non terminal errors are reported in errors lists within each JSON Line. The same information is reported in the training and testing validation result manifests that Amazon Rekognition Custom Labels creates during model training.

You can filter the response in variety of ways, such as choosing which labels to return and returning JSON Lines created after a specific date.

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

Parameters:

  • dataset_arn (DatasetArn) –

    The Amazon Resource Name (ARN) for the dataset that you want to use.

  • contains_labels (Optional[DatasetLabels], default: None ) –

    Specifies a label filter for the response. The response includes an entry only if one or more of the labels in ContainsLabels exist in the entry.

  • labeled (Optional[IsLabeled], default: None ) –

    Specify true to get only the JSON Lines where the image is labeled. Specify false to get only the JSON Lines where the image isn't labeled. If you don't specify Labeled, ListDatasetEntries returns JSON Lines for labeled and unlabeled images.

  • source_ref_contains (Optional[QueryString], default: None ) –

    If specified, ListDatasetEntries only returns JSON Lines where the value of SourceRefContains is part of the source-ref field. The source-ref field contains the Amazon S3 location of the image. You can use SouceRefContains for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.

  • has_errors (Optional[HasErrors], default: None ) –

    Specifies an error filter for the response. Specify True to only include entries that have errors.

  • next_token (Optional[ExtendedPaginationToken], default: None ) –

    If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results.

  • max_results (Optional[ListDatasetEntriesPageSize], default: None ) –

    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.

Raises:

Examples:

To list the entries in an Amazon Rekognition Custom Labels dataset Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset.

>>> client.list_dataset_entries(dataset_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106', contains_labels=['camellia'], labeled=True, source_ref_contains='camellia4.jpg', has_errors=True, next_token='', max_results=100)
Source code in docs_src/capo_rekognition/_services/rekognition.py
def list_dataset_entries(
    self,
    dataset_arn: "capo_rekognition.types.dataset_arn.DatasetArn",
    *,
    config_overrides: Optional[RekognitionClientConfig] = None,
    contains_labels: Optional[
        "capo_rekognition.types.dataset_labels.DatasetLabels"
    ] = None,
    labeled: Optional["capo_rekognition.types.is_labeled.IsLabeled"] = None,
    source_ref_contains: Optional[
        "capo_rekognition.types.query_string.QueryString"
    ] = None,
    has_errors: Optional["capo_rekognition.types.has_errors.HasErrors"] = None,
    next_token: Optional[
        "capo_rekognition.types.extended_pagination_token.ExtendedPaginationToken"
    ] = None,
    max_results: Optional[
        "capo_rekognition.types.list_dataset_entries_page_size.ListDatasetEntriesPageSize"
    ] = None,
) -> "capo_rekognition.types.list_dataset_entries_response.ListDatasetEntriesResponse":
    """<note> <p>This operation applies only to Amazon Rekognition Custom Labels.</p> </note> <p> Lists the entries (images) within a dataset. An entry is a JSON Line that contains the information for a single image, including the image location, assigned labels, and object location bounding boxes. For more information, see <a href="https://docs.aws.amazon.com/rekognition/latest/customlabels-dg/md-manifest-files.html">Creating a manifest file</a>.</p> <p>JSON Lines in the response include information about non-terminal errors found in the dataset. Non terminal errors are reported in <code>errors</code> lists within each JSON Line. The same information is reported in the training and testing validation result manifests that Amazon Rekognition Custom Labels creates during model training. </p> <p>You can filter the response in variety of ways, such as choosing which labels to return and returning JSON Lines created after a specific date. </p> <p>This operation requires permissions to perform the <code>rekognition:ListDatasetEntries</code> action.</p>

    Args:
        dataset_arn: <p> The Amazon Resource Name (ARN) for the dataset that you want to use. </p>
        contains_labels: <p>Specifies a label filter for the response. The response includes an entry only if one or more of the labels in <code>ContainsLabels</code> exist in the entry. </p>
        labeled: <p> Specify <code>true</code> to get only the JSON Lines where the image is labeled. Specify <code>false</code> to get only the JSON Lines where the image isn't labeled. If you don't specify <code>Labeled</code>, <code>ListDatasetEntries</code> returns JSON Lines for labeled and unlabeled images. </p>
        source_ref_contains: <p>If specified, <code>ListDatasetEntries</code> only returns JSON Lines where the value of <code>SourceRefContains</code> is part of the <code>source-ref</code> field. The <code>source-ref</code> field contains the Amazon S3 location of the image. You can use <code>SouceRefContains</code> for tasks such as getting the JSON Line for a single image, or gettting JSON Lines for all images within a specific folder.</p>
        has_errors: <p>Specifies an error filter for the response. Specify <code>True</code> to only include entries that have errors. </p>
        next_token: <p>If the previous response was incomplete (because there is more results to retrieve), Amazon Rekognition Custom Labels returns a pagination token in the response. You can use this pagination token to retrieve the next set of results. </p>
        max_results: <p>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. </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_pagination_token_exception.InvalidPaginationTokenException: <p>Pagination token in the request is not valid.</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_in_use_exception.ResourceInUseException: <p>The specified resource is already being used.</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 list the entries in an Amazon Rekognition Custom Labels dataset
        Lists the JSON line entries in an Amazon Rekognition Custom Labels dataset.

        >>> client.list_dataset_entries(dataset_arn='arn:aws:rekognition:us-east-1:111122223333:project/my-proj-2/dataset/train/1690564858106', contains_labels=['camellia'], labeled=True, source_ref_contains='camellia4.jpg', has_errors=True, next_token='', max_results=100)
    """

    def _handler(
        req: "OperationRequest[capo_rekognition.types.list_dataset_entries_request.ListDatasetEntriesRequest]",
    ) -> OperationResponse[
        "capo_rekognition.types.list_dataset_entries_response.ListDatasetEntriesResponse"
    ]:
        import capo_rekognition._operations.rekognition_service.list_dataset_entries

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListDatasetEntries")
    )
    input_: capo_rekognition.types.list_dataset_entries_request.ListDatasetEntriesRequest = {
        "dataset_arn": dataset_arn
    }
    if contains_labels is not None:
        input_["contains_labels"] = contains_labels
    if labeled is not None:
        input_["labeled"] = labeled
    if source_ref_contains is not None:
        input_["source_ref_contains"] = source_ref_contains
    if has_errors is not None:
        input_["has_errors"] = has_errors
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

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