Data Labeling API . projects . datasets . dataItems

Instance Methods

close()

Close httplib2 connections.

get(name, x__xgafv=None)

Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)

Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.

list_next(previous_request, previous_response)

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
get(name, x__xgafv=None)
Gets a data item in a dataset by resource name. This API can be called after data are imported into dataset.

Args:
  name: string, Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id} (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # DataItem is a piece of data, without annotation. For example, an image.
    "textPayload": { # Container of information about a piece of text. # The text payload, a container of text content.
      "textContent": "A String", # Text content.
    },
    "imagePayload": { # Container of information about an image. # The image payload, a container of the image bytes/uri.
      "mimeType": "A String", # Image format.
      "imageThumbnail": "A String", # A byte string of a thumbnail image.
      "signedUri": "A String", # Signed uri of the image file in the service bucket.
      "imageUri": "A String", # Image uri from the user bucket.
    },
    "videoPayload": { # Container of information of a video. # The video payload, a container of the video uri.
      "signedUri": "A String", # Signed uri of the video file in the service bucket.
      "mimeType": "A String", # Video format.
      "videoUri": "A String", # Video uri from the user bucket.
      "videoThumbnails": [ # The list of video thumbnails.
        { # Container of information of a video thumbnail.
          "timeOffset": "A String", # Time offset relative to the beginning of the video, corresponding to the video frame where the thumbnail has been extracted from.
          "thumbnail": "A String", # A byte string of the video frame.
        },
      ],
      "frameRate": 3.14, # FPS of the video.
    },
    "name": "A String", # Output only. Name of the data item, in format of: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}
  }
list(parent, pageSize=None, pageToken=None, filter=None, x__xgafv=None)
Lists data items in a dataset. This API can be called after data are imported into dataset. Pagination is supported.

Args:
  parent: string, Required. Name of the dataset to list data items, format: projects/{project_id}/datasets/{dataset_id} (required)
  pageSize: integer, Optional. Requested page size. Server may return fewer results than requested. Default value is 100.
  pageToken: string, Optional. A token identifying a page of results for the server to return. Typically obtained by ListDataItemsResponse.next_page_token of the previous [DataLabelingService.ListDataItems] call. Return first page if empty.
  filter: string, Optional. Filter is not supported at this moment.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Results of listing data items in a dataset.
    "nextPageToken": "A String", # A token to retrieve next page of results.
    "dataItems": [ # The list of data items to return.
      { # DataItem is a piece of data, without annotation. For example, an image.
        "textPayload": { # Container of information about a piece of text. # The text payload, a container of text content.
          "textContent": "A String", # Text content.
        },
        "imagePayload": { # Container of information about an image. # The image payload, a container of the image bytes/uri.
          "mimeType": "A String", # Image format.
          "imageThumbnail": "A String", # A byte string of a thumbnail image.
          "signedUri": "A String", # Signed uri of the image file in the service bucket.
          "imageUri": "A String", # Image uri from the user bucket.
        },
        "videoPayload": { # Container of information of a video. # The video payload, a container of the video uri.
          "signedUri": "A String", # Signed uri of the video file in the service bucket.
          "mimeType": "A String", # Video format.
          "videoUri": "A String", # Video uri from the user bucket.
          "videoThumbnails": [ # The list of video thumbnails.
            { # Container of information of a video thumbnail.
              "timeOffset": "A String", # Time offset relative to the beginning of the video, corresponding to the video frame where the thumbnail has been extracted from.
              "thumbnail": "A String", # A byte string of the video frame.
            },
          ],
          "frameRate": 3.14, # FPS of the video.
        },
        "name": "A String", # Output only. Name of the data item, in format of: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}
      },
    ],
  }
list_next(previous_request, previous_response)
Retrieves the next page of results.

Args:
  previous_request: The request for the previous page. (required)
  previous_response: The response from the request for the previous page. (required)

Returns:
  A request object that you can call 'execute()' on to request the next
  page. Returns None if there are no more items in the collection.