Package google.cloud.datalabeling.v1beta1

Index

DataLabelingService

CreateAnnotationSpecSet

rpc CreateAnnotationSpecSet(CreateAnnotationSpecSetRequest) returns (AnnotationSpecSet)

Creates an annotation spec set by providing a set of labels.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateDataset

rpc CreateDataset(CreateDatasetRequest) returns (Dataset)

Creates dataset. If success return a Dataset resource.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

CreateInstruction

rpc CreateInstruction(CreateInstructionRequest) returns (Operation)

Creates an instruction for how data should be labeled.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteAnnotatedDataset

rpc DeleteAnnotatedDataset(DeleteAnnotatedDatasetRequest) returns (Empty)

Deletes an annotated dataset by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteAnnotationSpecSet

rpc DeleteAnnotationSpecSet(DeleteAnnotationSpecSetRequest) returns (Empty)

Deletes an annotation spec set by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteDataset

rpc DeleteDataset(DeleteDatasetRequest) returns (Empty)

Deletes a dataset by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

DeleteInstruction

rpc DeleteInstruction(DeleteInstructionRequest) returns (Empty)

Deletes an instruction object by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ExportData

rpc ExportData(ExportDataRequest) returns (Operation)

Exports data and annotations from dataset.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetAnnotatedDataset

rpc GetAnnotatedDataset(GetAnnotatedDatasetRequest) returns (AnnotatedDataset)

Gets an annotated dataset by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetAnnotationSpecSet

rpc GetAnnotationSpecSet(GetAnnotationSpecSetRequest) returns (AnnotationSpecSet)

Gets an annotation spec set by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetDataItem

rpc GetDataItem(GetDataItemRequest) returns (DataItem)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetDataset

rpc GetDataset(GetDatasetRequest) returns (Dataset)

Gets dataset by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetExample

rpc GetExample(GetExampleRequest) returns (Example)

Gets an example by resource name, including both data and annotation.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

GetInstruction

rpc GetInstruction(GetInstructionRequest) returns (Instruction)

Gets an instruction by resource name.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ImportData

rpc ImportData(ImportDataRequest) returns (Operation)

Imports data into dataset based on source locations defined in request. It can be called multiple times for the same dataset. Each dataset can only have one long running operation running on it. For example, no labeling task (also long running operation) can be started while importing is still ongoing. Vice versa.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

LabelImage

rpc LabelImage(LabelImageRequest) returns (Operation)

Starts a labeling task for image. The type of image labeling task is configured by feature in the request.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

LabelText

rpc LabelText(LabelTextRequest) returns (Operation)

Starts a labeling task for text. The type of text labeling task is configured by feature in the request.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

LabelVideo

rpc LabelVideo(LabelVideoRequest) returns (Operation)

Starts a labeling task for video. The type of video labeling task is configured by feature in the request.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListAnnotatedDatasets

rpc ListAnnotatedDatasets(ListAnnotatedDatasetsRequest) returns (ListAnnotatedDatasetsResponse)

Lists annotated datasets for a dataset. Pagination is supported.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListAnnotationSpecSets

rpc ListAnnotationSpecSets(ListAnnotationSpecSetsRequest) returns (ListAnnotationSpecSetsResponse)

Lists annotation spec sets for a project. Pagination is supported.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListDataItems

rpc ListDataItems(ListDataItemsRequest) returns (ListDataItemsResponse)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListDatasets

rpc ListDatasets(ListDatasetsRequest) returns (ListDatasetsResponse)

Lists datasets under a project. Pagination is supported.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListExamples

rpc ListExamples(ListExamplesRequest) returns (ListExamplesResponse)

Lists examples in an annotated dataset. Pagination is supported.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ListInstructions

rpc ListInstructions(ListInstructionsRequest) returns (ListInstructionsResponse)

Lists instructions for a project. Pagination is supported.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

AnnotatedDataset

AnnotatedDataset is a set holding annotations for data in a Dataset. Each labeling task will generate an AnnotatedDataset under the Dataset that the task is requested for.

Fields
name

string

Output only. AnnotatedDataset resource name in format of: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

display_name

string

Output only. The display name of the AnnotatedDataset. It is specified in HumanAnnotationConfig when user starts a labeling task. Maximum of 64 characters.

description

string

Output only. The description of the AnnotatedDataset. It is specified in HumanAnnotationConfig when user starts a labeling task. Maximum of 10000 characters.

annotation_source

AnnotationSource

Output only. Source of the annotation.

annotation_type

AnnotationType

Output only. Type of the annotation. It is specified when starting labeling task.

example_count

int64

Output only. Number of examples in the annotated dataset.

completed_example_count

int64

Output only. Number of examples that have annotation in the annotated dataset.

label_stats

LabelStats

Output only. Per label statistics.

create_time

Timestamp

Output only. Time the AnnotatedDataset was created.

metadata

AnnotatedDatasetMetadata

Output only. Additional information about AnnotatedDataset.

blocking_resources[]

string

Output only. The names of any related resources that are blocking changes to the annotated dataset.

AnnotatedDatasetMetadata

Metadata on AnnotatedDataset.

Fields
human_annotation_config

HumanAnnotationConfig

HumanAnnotationConfig used when requesting the human labeling task for this AnnotatedDataset.

Union field annotation_request_config. Specific request configuration used when requesting the labeling task. annotation_request_config can be only one of the following:
image_classification_config

ImageClassificationConfig

Configuration for image classification task.

bounding_poly_config

BoundingPolyConfig

Configuration for image bounding box and bounding poly task.

polyline_config

PolylineConfig

Configuration for image polyline task.

segmentation_config

SegmentationConfig

Configuration for image segmentation task.

video_classification_config

VideoClassificationConfig

Configuration for video classification task.

object_detection_config

ObjectDetectionConfig

Configuration for video object detection task.

object_tracking_config

ObjectTrackingConfig

Configuration for video object tracking task.

event_config

EventConfig

Configuration for video event labeling task.

text_classification_config

TextClassificationConfig

Configuration for text classification task.

text_entity_extraction_config

TextEntityExtractionConfig

Configuration for text entity extraction task.

Annotation

Annotation for Example. Each example may have one or more annotations. For example in image classification problem, each image might have one or more labels. We call labels binded with this image an Annotation.

Fields
name

string

Output only. Unique name of this annotation, format is:

projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotated_dataset}/examples/{example_id}/annotations/{annotation_id}

annotation_source

AnnotationSource

Output only. The source of the annotation.

annotation_value

AnnotationValue

Output only. This is the actual annotation value, e.g classification, bounding box values are stored here.

annotation_metadata

AnnotationMetadata

Output only. Annotation metadata, including information like votes for labels.

annotation_sentiment

AnnotationSentiment

Output only. Sentiment for this annotation.

AnnotationMetadata

Additional information associated with the annotation.

Fields
operator_metadata

OperatorMetadata

Metadata related to human labeling.

AnnotationSentiment

Enums
ANNOTATION_SENTIMENT_UNSPECIFIED
NEGATIVE This annotation describes negatively about the data.
POSITIVE This label describes positively about the data.

AnnotationSource

Specifies where is the answer from.

Enums
ANNOTATION_SOURCE_UNSPECIFIED
OPERATOR Answer is provided by a human contributor.

AnnotationSpec

Container of information related to one annotation spec.

Fields
display_name

string

Required. The display name of the AnnotationSpec. Maximum of 64 characters.

description

string

Optional. User-provided description of the annotation specification. The description can be up to 10000 characters long.

AnnotationSpecSet

AnnotationSpecSet is a collection of label definitions. For example, in image classification tasks, we define a set of labels, this set is called AnnotationSpecSet. AnnotationSpecSet is immutable upon creation.

Fields
name

string

Output only. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}

display_name

string

Required. The display name for AnnotationSpecSet defined by user. Maximum of 64 characters.

description

string

Optional. User-provided description of the annotation specification set. The description can be up to 10000 characters long.

annotation_specs[]

AnnotationSpec

Required. The actual spec set defined by the users.

blocking_resources[]

string

Output only. The names of any related resources that are blocking changes to the annotation spec set.

AnnotationType

Enums
ANNOTATION_TYPE_UNSPECIFIED
IMAGE_CLASSIFICATION_ANNOTATION Classification annotations in an image.
IMAGE_BOUNDING_BOX_ANNOTATION Bounding box annotations in an image.
IMAGE_ORIENTED_BOUNDING_BOX_ANNOTATION Oriented bounding box. The box does not have to be parallel to horizontal line.
IMAGE_BOUNDING_POLY_ANNOTATION Bounding poly annotations in an image.
IMAGE_POLYLINE_ANNOTATION Polyline annotations in an image.
IMAGE_SEGMENTATION_ANNOTATION Segmentation annotations in an image.
VIDEO_SHOTS_CLASSIFICATION_ANNOTATION Classification annotations in video shots.
VIDEO_OBJECT_TRACKING_ANNOTATION Video object tracking annotation.
VIDEO_OBJECT_DETECTION_ANNOTATION Video object detection annotation.
VIDEO_EVENT_ANNOTATION Video event annotation.
TEXT_CLASSIFICATION_ANNOTATION Classification for text.
TEXT_ENTITY_EXTRACTION_ANNOTATION Entity extraction for text.

AnnotationValue

Annotation value for an example.

Fields

Union field value_type.

value_type can be only one of the following:

image_classification_annotation

ImageClassificationAnnotation

Annotation value for image classification case.

image_bounding_poly_annotation

ImageBoundingPolyAnnotation

Annotation value for image bounding box, oriented bounding box and polygon cases.

image_polyline_annotation

ImagePolylineAnnotation

Annotation value for image polyline cases. Polyline here is different from BoundingPoly. It is formed by line segments connected to each other but not closed form(Bounding Poly). The line segments can cross each other.

image_segmentation_annotation

ImageSegmentationAnnotation

Annotation value for image segmentation.

text_classification_annotation

TextClassificationAnnotation

Annotation value for text classification case.

text_entity_extraction_annotation

TextEntityExtractionAnnotation

Annotation value for text entity extraction case.

video_classification_annotation

VideoClassificationAnnotation

Annotation value for video classification case.

video_object_tracking_annotation

VideoObjectTrackingAnnotation

Annotation value for video object detection and tracking case.

video_event_annotation

VideoEventAnnotation

Annotation value for video event case.

BoundingPoly

A bounding polygon in the image.

Fields
vertices[]

Vertex

The bounding polygon vertices.

BoundingPolyConfig

Config for image bounding poly (and bounding box) human labeling task.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

instruction_message

string

Optional. Instruction message showed on contributors UI.

CreateAnnotationSpecSetRequest

Request message for CreateAnnotationSpecSet.

Fields
parent

string

Required. AnnotationSpecSet resource parent, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotationspecsets.create

annotation_spec_set

AnnotationSpecSet

Required. Annotation spec set to create. Annotation specs must be included. Only one annotation spec will be accepted for annotation specs with same display_name.

CreateDatasetRequest

Request message for CreateDataset.

Fields
parent

string

Required. Dataset resource parent, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.datasets.create

dataset

Dataset

Required. The dataset to be created.

CreateInstructionMetadata

Metadata of a CreateInstruction operation.

Fields
instruction

string

The name of the created Instruction. projects/{project_id}/instructions/{instruction_id}

partial_failures[]

Status

Partial failures encountered. E.g. single files that couldn't be read. Status details field will contain standard GCP error details.

create_time

Timestamp

Timestamp when create instruction request was created.

CreateInstructionRequest

Request message for CreateInstruction.

Fields
parent

string

Required. Instruction resource parent, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.instructions.create

instruction

Instruction

Required. Instruction of how to perform the labeling task.

CsvInstruction

Instruction from a CSV file.

Fields
gcs_file_uri

string

CSV file for the instruction. Only gcs path is allowed.

DataItem

DataItem is a piece of data, without annotation. For example, an image.

Fields
name

string

Output only. Name of the data item, in format of: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}

Union field payload. Output only. payload can be only one of the following:
image_payload

ImagePayload

The image payload, a container of the image bytes/uri.

text_payload

TextPayload

The text payload, a container of text content.

video_payload

VideoPayload

The video payload, a container of the video uri.

DataType

Enums
DATA_TYPE_UNSPECIFIED
IMAGE
VIDEO
TEXT

Dataset

Dataset is the resource to hold your data. You can request multiple labeling tasks for a dataset while each one will generate an AnnotatedDataset.

Fields
name

string

Output only. Dataset resource name, format is: projects/{project_id}/datasets/{dataset_id}

display_name

string

Required. The display name of the dataset. Maximum of 64 characters.

description

string

Optional. User-provided description of the annotation specification set. The description can be up to 10000 characters long.

create_time

Timestamp

Output only. Time the dataset is created.

input_configs[]

InputConfig

Output only. This is populated with the original input configs where ImportData is called. It is available only after the clients import data to this dataset.

blocking_resources[]

string

Output only. The names of any related resources that are blocking changes to the dataset.

data_item_count

int64

Output only. The number of data items in the dataset.

DeleteAnnotatedDatasetRequest

Request message for DeleteAnnotatedDataset.

Fields
name

string

Required. Name of the annotated dataset to delete, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.annotateddatasets.delete

DeleteAnnotationSpecSetRequest

Request message for DeleteAnnotationSpecSet.

Fields
name

string

Required. AnnotationSpec resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}.

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.annotationspecsets.delete

DeleteDatasetRequest

Request message for DeleteDataset.

Fields
name

string

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.datasets.delete

DeleteInstructionRequest

Request message for DeleteInstruction.

Fields
name

string

Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.instructions.delete

EventConfig

Config for video event human labeling task.

Fields
annotation_spec_sets[]

string

Required. The list of annotation spec set resource name. Similar to video classification, we support selecting event from multiple AnnotationSpecSet at the same time.

Example

An Example is a piece of data and its annotation. For example, an image with label "house".

Fields
name

string

Output only. Name of the example, in format of: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}/examples/{example_id}

annotations[]

Annotation

Output only. Annotations for the piece of data in Example. One piece of data can have multiple annotations.

Union field payload. Output only. The data part of Example. payload can be only one of the following:
image_payload

ImagePayload

The image payload, a container of the image bytes/uri.

text_payload

TextPayload

The text payload, a container of the text content.

video_payload

VideoPayload

The video payload, a container of the video uri.

ExportDataOperationMetadata

Metadata of an ExportData operation.

Fields
dataset

string

Output only. The name of dataset to be exported. "projects/*/datasets/*/Datasets/*"

partial_failures[]

Status

Output only. Partial failures encountered. E.g. single files that couldn't be read. Status details field will contain standard GCP error details.

create_time

Timestamp

Output only. Timestamp when export dataset request was created.

ExportDataOperationResponse

Response used for ExportDataset longrunning operation.

Fields
dataset

string

Ouptut only. The name of dataset. "projects/*/datasets/*/Datasets/*"

total_count

int32

Output only. Total number of examples requested to export

export_count

int32

Output only. Number of examples exported successfully.

label_stats

LabelStats

Output only. Statistic infos of labels in the exported dataset.

output_config

OutputConfig

Output only. output_config in the ExportData request.

ExportDataRequest

Request message for ExportData API.

Fields
name

string

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.datasets.export

annotated_dataset

string

Required. Annotated dataset resource name. DataItem in Dataset and their annotations in specified annotated dataset will be exported. It's in format of projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

filter

string

Optional. Filter is not supported at this moment.

output_config

OutputConfig

Required. Specify the output destination.

user_email_address

string

Email of the user who started the export task and should be notified by email. If empty no notification will be sent.

GcsDestination

Export destination of the data.Only gcs path is allowed in output_uri.

Fields
output_uri

string

Required. The output uri of destination file.

mime_type

string

Required. The format of the gcs destination. Only "text/csv" and "application/json" are supported.

GcsFolderDestination

Export folder destination of the data.

Fields
output_folder_uri

string

Required. Cloud Storage directory to export data to.

GcsSource

Source of the Cloud Storage file to be imported.

Fields
input_uri

string

Required. The input URI of source file. This must be a Cloud Storage path (gs://...).

mime_type

string

Required. The format of the source file. Only "text/csv" is supported.

GetAnnotatedDatasetRequest

Request message for GetAnnotatedDataset.

Fields
name

string

Required. Name of the annotated dataset to get, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.annotateddatasets.get

GetAnnotationSpecSetRequest

Request message for GetAnnotationSpecSet.

Fields
name

string

Required. AnnotationSpecSet resource name, format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.annotationspecsets.get

GetDataItemRequest

Request message for GetDataItem.

Fields
name

string

Required. The name of the data item to get, format: projects/{project_id}/datasets/{dataset_id}/dataItems/{data_item_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.dataitems.get

GetDatasetRequest

Request message for GetDataSet.

Fields
name

string

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.datasets.get

GetExampleRequest

Request message for GetExample

Fields
name

string

Required. Name of example, format: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}/examples/{example_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.examples.get

filter

string

Optional. An expression for filtering Examples. Filter by annotation_spec.display_name is supported. Format "annotation_spec.display_name = {display_name}"

GetInstructionRequest

Request message for GetInstruction.

Fields
name

string

Required. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.instructions.get

HumanAnnotationConfig

Configuration for how human labeling task should be done.

Fields
instruction

string

Required except for LabelAudio case. Instruction resource name.

annotated_dataset_display_name

string

Required. A human-readable name for AnnotatedDataset defined by users. Maximum of 64 characters .

annotated_dataset_description

string

Optional. A human-readable description for AnnotatedDataset. The description can be up to 10000 characters long.

label_group

string

Optional. A human-readable label used to logically group labeling tasks. This string must match the regular expression [a-zA-Z\\d_-]{0,128}.

language_code

string

Optional. The Language of this question, as a BCP-47. Default value is en-US. Only need to set this when task is language related. For example, French text classification or Chinese audio transcription.

replica_count

int32

Optional. Replication of questions. Each question will be sent to up to this number of contributors to label. Aggregated answers will be returned. Default is set to 1. For image related labeling, valid values are 1, 3, 5.

question_duration

Duration

Optional. Maximum duration for contributors to answer a question. Default is 1800 seconds.

contributor_emails[]

string

Optional. If you want your own labeling contributors to manage and work on this labeling request, you can set these contributors here. We will give them access to the question types in crowdcompute. Note that these emails must be registered in crowdcompute worker UI: https://crowd-compute.appspot.com/

user_email_address

string

Email of the user who started the labeling task and should be notified by email. If empty no notification will be sent.

ImageBoundingPolyAnnotation

Image bounding poly annotation. It represents a polygon including bounding box in the image.

Fields
annotation_spec

AnnotationSpec

Label of object in this bounding polygon.

Union field bounded_area. The region of the polygon. If it is a bounding box, it is guaranteed to be four points. bounded_area can be only one of the following:
bounding_poly

BoundingPoly

normalized_bounding_poly

NormalizedBoundingPoly

ImageClassificationAnnotation

Image classification annotation definition.

Fields
annotation_spec

AnnotationSpec

Label of image.

ImageClassificationConfig

Config for image classification human labeling task.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

allow_multi_label

bool

Optional. If allow_multi_label is true, contributors are able to choose multiple labels for one image.

answer_aggregation_type

StringAggregationType

Optional. The type of how to aggregate answers.

ImagePayload

Container of information about an image.

Fields
mime_type

string

Image format.

image_thumbnail

bytes

A byte string of a thumbnail image.

image_uri

string

Image uri from the user bucket.

signed_uri

string

Signed uri of the image file in the service bucket.

ImagePolylineAnnotation

A polyline for the image annotation.

Fields
annotation_spec

AnnotationSpec

Label of this polyline.

Union field poly.

poly can be only one of the following:

polyline

Polyline

normalized_polyline

NormalizedPolyline

ImageSegmentationAnnotation

Image segmentation annotation.

Fields
annotation_colors

map<string, AnnotationSpec>

The mapping between rgb color and annotation spec. The key is the rgb color represented in format of rgb(0, 0, 0). The value is the AnnotationSpec.

mime_type

string

Image format.

image_bytes

bytes

A byte string of a full image's color map.

ImportDataOperationMetadata

Metadata of an ImportData operation.

Fields
dataset

string

Ouptut only. The name of imported dataset. "projects/*/datasets/*"

partial_failures[]

Status

Output only. Partial failures encountered. E.g. single files that couldn't be read. Status details field will contain standard GCP error details.

create_time

Timestamp

Output only. Timestamp when import dataset request was created.

ImportDataOperationResponse

Response used for ImportData longrunning operation.

Fields
dataset

string

Ouptut only. The name of imported dataset.

total_count

int32

Output only. Total number of examples requested to import

import_count

int32

Output only. Number of examples imported successfully.

ImportDataRequest

Request message for ImportData API.

Fields
name

string

Required. Dataset resource name, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource name:

  • datalabeling.datasets.import

input_config

InputConfig

Required. Specify the input source of the data.

user_email_address

string

Email of the user who started the import task and should be notified by email. If empty no notification will be sent.

InputConfig

The configuration of input data, including data type, location, etc.

Fields
data_type

DataType

Required. Data type must be specifed when user tries to import data.

text_metadata

TextMetadata

Required for text import, as language code must be specified.

gcs_source

GcsSource

Source located in Cloud Storage.

Instruction

Instruction of how to perform the labeling task for human operators. Currently two types of instruction are supported - CSV file and PDF. One of the two types instruction must be provided. CSV file is only supported for image classification task. Instructions for other task should be provided as PDF. For image classification, CSV and PDF can be provided at the same time.

Fields
name

string

Output only. Instruction resource name, format: projects/{project_id}/instructions/{instruction_id}

display_name

string

Required. The display name of the instruction. Maximum of 64 characters.

description

string

Optional. User-provided description of the instruction. The description can be up to 10000 characters long.

create_time

Timestamp

Output only. Creation time of instruction.

update_time

Timestamp

Output only. Last update time of instruction.

data_type

DataType

Required. The data type of this instruction.

csv_instruction

CsvInstruction

One of CSV or PDF instruction is required. Instruction from a CSV file, such as for classification task. The CSV file should have exact two columns, in the following format:

  • The first column is labeled data, such as an image reference, text.
  • The second column is comma separated labels associated with data.

pdf_instruction

PdfInstruction

One of CSV or PDF instruction is required. Instruction from a PDF document. The PDF should be in a Cloud Storage bucket.

blocking_resources[]

string

Output only. The names of any related resources that are blocking changes to the instruction.

LabelImageBoundingBoxOperationMetadata

Details of a LabelImageBoundingBox operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelImageBoundingPolyOperationMetadata

Details of LabelImageBoundingPoly operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelImageClassificationOperationMetadata

Metadata of a LabelImageClassification operation.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelImageOrientedBoundingBoxOperationMetadata

Details of a LabelImageOrientedBoundingBox operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config.

LabelImagePolylineOperationMetadata

Details of LabelImagePolyline operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelImageRequest

Request message for starting an image labeling task.

Fields
parent

string

Required. Name of the dataset to request labeling task, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotateddatasets.label

basic_config

HumanAnnotationConfig

Required. Basic human annotation config.

feature

Feature

Required. The type of image labeling task.

Union field request_config. Required. Config for labeling tasks. The type of request config must match the selected feature. request_config can be only one of the following:
image_classification_config

ImageClassificationConfig

Configuration for image classification task. One of image_classification_config, bounding_poly_config, polyline_config and segmentation_config are required.

bounding_poly_config

BoundingPolyConfig

Configuration for bounding box and bounding poly task. One of image_classification_config, bounding_poly_config, polyline_config and segmentation_config are required.

polyline_config

PolylineConfig

Configuration for polyline task. One of image_classification_config, bounding_poly_config, polyline_config and segmentation_config are required.

segmentation_config

SegmentationConfig

Configuration for segmentation task. One of image_classification_config, bounding_poly_config, polyline_config and segmentation_config are required.

Feature

Image labeling task feature.

Enums
FEATURE_UNSPECIFIED
CLASSIFICATION Label whole image with one or more of labels.
BOUNDING_BOX Label image with bounding boxes for labels.
ORIENTED_BOUNDING_BOX Label oriented bounding box. The box does not have to be parallel to horizontal line.
BOUNDING_POLY Label images with bounding poly. A bounding poly is a plane figure that is bounded by a finite chain of straight line segments closing in a loop.
POLYLINE Label images with polyline. Polyline is formed by connected line segments which are not in closed form.
SEGMENTATION Label images with segmentation. Segmentation is different from bounding poly since it is more fine-grained, pixel level annotation.

LabelImageSegmentationOperationMetadata

Details of a LabelImageSegmentation operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config.

LabelOperationMetadata

Metadata of a labeling operation, such as LabelImage or LabelVideo. Next tag: 18

Fields
progress_percent

int32

Output only. Progress of label operation. Range: [0, 100].

partial_failures[]

Status

Output only. Partial failures encountered. E.g. single files that couldn't be read. Status details field will contain standard GCP error details.

create_time

Timestamp

Output only. Timestamp when labeling request was created.

Union field details. Ouptut only. Details of specific label operation. details can be only one of the following:
image_classification_details

LabelImageClassificationOperationMetadata

Details of label image classification operation.

image_bounding_box_details

LabelImageBoundingBoxOperationMetadata

Details of label image bounding box operation.

image_bounding_poly_details

LabelImageBoundingPolyOperationMetadata

Details of label image bounding poly operation.

image_oriented_bounding_box_details

LabelImageOrientedBoundingBoxOperationMetadata

Details of label image oriented bounding box operation.

image_polyline_details

LabelImagePolylineOperationMetadata

Details of label image polyline operation.

image_segmentation_details

LabelImageSegmentationOperationMetadata

Details of label image segmentation operation.

video_classification_details

LabelVideoClassificationOperationMetadata

Details of label video classification operation.

video_object_detection_details

LabelVideoObjectDetectionOperationMetadata

Details of label video object detection operation.

video_object_tracking_details

LabelVideoObjectTrackingOperationMetadata

Details of label video object tracking operation.

video_event_details

LabelVideoEventOperationMetadata

Details of label video event operation.

text_classification_details

LabelTextClassificationOperationMetadata

Details of label text classification operation.

text_entity_extraction_details

LabelTextEntityExtractionOperationMetadata

Details of label text entity extraction operation.

LabelStats

Statistics about annotation specs.

Fields
example_count

map<string, int64>

Map of each annotation spec's example count. Key is the annotation spec name and value is the number of examples for that annotation spec. If the annotated dataset does not have annotation spec, the map will return a pair where the key is empty string and value is the total number of annotations.

LabelTextClassificationOperationMetadata

Details of a LabelTextClassification operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelTextEntityExtractionOperationMetadata

Details of a LabelTextEntityExtraction operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelTextRequest

Request message for LabelText.

Fields
parent

string

Required. Name of the data set to request labeling task, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotateddatasets.label

basic_config

HumanAnnotationConfig

Required. Basic human annotation config.

feature

Feature

Required. The type of text labeling task.

Union field request_config. Required. Config for labeling tasks. The type of request config must match the selected feature. request_config can be only one of the following:
text_classification_config

TextClassificationConfig

Configuration for text classification task. One of text_classification_config and text_entity_extraction_config is required.

text_entity_extraction_config

TextEntityExtractionConfig

Configuration for entity extraction task. One of text_classification_config and text_entity_extraction_config is required.

Feature

Text labeling task feature.

Enums
FEATURE_UNSPECIFIED
TEXT_CLASSIFICATION Label text content to one of more labels.
TEXT_ENTITY_EXTRACTION Label entities and their span in text.

LabelVideoClassificationOperationMetadata

Details of a LabelVideoClassification operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelVideoEventOperationMetadata

Details of a LabelVideoEvent operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelVideoObjectDetectionOperationMetadata

Details of a LabelVideoObjectDetection operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelVideoObjectTrackingOperationMetadata

Details of a LabelVideoObjectTracking operation metadata.

Fields
basic_config

HumanAnnotationConfig

Basic human annotation config used in labeling request.

LabelVideoRequest

Request message for LabelVideo.

Fields
parent

string

Required. Name of the dataset to request labeling task, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotateddatasets.label

basic_config

HumanAnnotationConfig

Required. Basic human annotation config.

feature

Feature

Required. The type of video labeling task.

Union field request_config. Required. Config for labeling tasks. The type of request config must match the selected feature. request_config can be only one of the following:
video_classification_config

VideoClassificationConfig

Configuration for video classification task. One of video_classification_config, object_detection_config, object_tracking_config and event_config is required.

object_detection_config

ObjectDetectionConfig

Configuration for video object detection task. One of video_classification_config, object_detection_config, object_tracking_config and event_config is required.

object_tracking_config

ObjectTrackingConfig

Configuration for video object tracking task. One of video_classification_config, object_detection_config, object_tracking_config and event_config is required.

event_config

EventConfig

Configuration for video event task. One of video_classification_config, object_detection_config, object_tracking_config and event_config is required.

Feature

Video labeling task feature.

Enums
FEATURE_UNSPECIFIED
CLASSIFICATION Label whole video or video segment with one or more labels.
OBJECT_DETECTION Label objects with bounding box on image frames extracted from the video.
OBJECT_TRACKING Label and track objects in video.
EVENT Label the range of video for the specified events.

ListAnnotatedDatasetsRequest

Request message for ListAnnotatedDatasets.

Fields
parent

string

Required. Name of the dataset to list annotated datasets, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotateddatasets.list

filter

string

Optional. Filter is not supported at this moment.

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

string

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotatedDatasetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotatedDatasets] call. Return first page if empty.

ListAnnotatedDatasetsResponse

Results of listing annotated datasets for a dataset.

Fields
annotated_datasets[]

AnnotatedDataset

The list of annotated datasets to return.

next_page_token

string

A token to retrieve next page of results.

ListAnnotationSpecSetsRequest

Request message for ListAnnotationSpecSets.

Fields
parent

string

Required. Parent of AnnotationSpecSet resource, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.annotationspecsets.list

filter

string

Optional. Filter is not supported at this moment.

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

string

Optional. A token identifying a page of results for the server to return. Typically obtained by ListAnnotationSpecSetsResponse.next_page_token of the previous [DataLabelingService.ListAnnotationSpecSets] call. Return first page if empty.

ListAnnotationSpecSetsResponse

Results of listing annotation spec set under a project.

Fields
annotation_spec_sets[]

AnnotationSpecSet

The list of annotation spec sets.

next_page_token

string

A token to retrieve next page of results.

ListDataItemsRequest

Request message for ListDataItems.

Fields
parent

string

Required. Name of the dataset to list data items, format: projects/{project_id}/datasets/{dataset_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.dataitems.list

filter

string

Optional. Filter is not supported at this moment.

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

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.

ListDataItemsResponse

Results of listing data items in a dataset.

Fields
data_items[]

DataItem

The list of data items to return.

next_page_token

string

A token to retrieve next page of results.

ListDatasetsRequest

Request message for ListDataset.

Fields
parent

string

Required. Dataset resource parent, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.datasets.list

filter

string

Optional. Filter on dataset is not supported at this moment.

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

string

Optional. A token identifying a page of results for the server to return. Typically obtained by ListDatasetsResponse.next_page_token of the previous [DataLabelingService.ListDatasets] call. Returns the first page if empty.

ListDatasetsResponse

Results of listing datasets within a project.

Fields
datasets[]

Dataset

The list of datasets to return.

next_page_token

string

A token to retrieve next page of results.

ListExamplesRequest

Request message for ListExamples.

Fields
parent

string

Required. Example resource parent.

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.examples.list

filter

string

Optional. An expression for filtering Examples. For annotated datasets that have annotation spec set, filter by annotation_spec.display_name is supported. Format "annotation_spec.display_name = {display_name}"

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

string

Optional. A token identifying a page of results for the server to return. Typically obtained by ListExamplesResponse.next_page_token of the previous [DataLabelingService.ListExamples] call. Return first page if empty.

ListExamplesResponse

Results of listing Examples in and annotated dataset.

Fields
examples[]

Example

The list of examples to return.

next_page_token

string

A token to retrieve next page of results.

ListInstructionsRequest

Request message for ListInstructions.

Fields
parent

string

Required. Instruction resource parent, format: projects/{project_id}

Authorization requires the following Google IAM permission on the specified resource parent:

  • datalabeling.instructions.list

filter

string

Optional. Filter is not supported at this moment.

page_size

int32

Optional. Requested page size. Server may return fewer results than requested. Default value is 100.

page_token

string

Optional. A token identifying a page of results for the server to return. Typically obtained by ListInstructionsResponse.next_page_token of the previous [DataLabelingService.ListInstructions] call. Return first page if empty.

ListInstructionsResponse

Results of listing instructions under a project.

Fields
instructions[]

Instruction

The list of Instructions to return.

next_page_token

string

A token to retrieve next page of results.

NormalizedBoundingPoly

Normalized bounding polygon.

Fields
normalized_vertices[]

NormalizedVertex

The bounding polygon normalized vertices.

NormalizedPolyline

Normalized polyline.

Fields
normalized_vertices[]

NormalizedVertex

The normalized polyline vertices.

NormalizedVertex

A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.

Fields
x

float

X coordinate.

y

float

Y coordinate.

ObjectDetectionConfig

Config for video object detection human labeling task. Object detection will be conducted on the images extracted from the video, and those objects will be labeled with bounding boxes. User need to specify the number of images to be extracted per second as the extraction frame rate.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

extraction_frame_rate

double

Required. Number of frames per second to be extracted from the video.

ObjectTrackingConfig

Config for video object tracking human labeling task.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

ObjectTrackingFrame

Video frame level annotation for object detection and tracking.

Fields
time_offset

Duration

The time offset of this frame relative to the beginning of the video.

Union field bounded_area. The bounding box location of this object track for the frame. bounded_area can be only one of the following:
bounding_poly

BoundingPoly

normalized_bounding_poly

NormalizedBoundingPoly

OperatorMetadata

General information useful for labels coming from contributors.

Fields
score

float

Confidence score corresponding to a label. For examle, if 3 contributors have answered the question and 2 of them agree on the final label, the confidence score will be 0.67 (2/3).

total_votes

int32

The total number of contributors that answer this question.

label_votes

int32

The total number of contributors that choose this label.

comments[]

string

Comments from contributors.

OutputConfig

The configuration of output data.

Fields
Union field destination. Required. Location to output data to. destination can be only one of the following:
gcs_destination

GcsDestination

Output to a file in Cloud Storage. Should be used for labeling output other than audio transcription and image segmentation.

gcs_folder_destination

GcsFolderDestination

Output to a folder in Cloud Storage. Should be used for audio transcription and image segmentation labeling output.

PdfInstruction

Instruction from a PDF file.

Fields
gcs_file_uri

string

PDF file for the instruction. Only gcs path is allowed.

Polyline

A line with multiple line segments.

Fields
vertices[]

Vertex

The polyline vertices.

PolylineConfig

Config for image polyline human labeling task.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

instruction_message

string

Optional. Instruction message showed on contributors UI.

SegmentationConfig

Config for image segmentation

Fields
annotation_spec_set

string

Required. Annotation spec set resource name. format: projects/{project_id}/annotationSpecSets/{annotation_spec_set_id}

instruction_message

string

Instruction message showed on labelers UI.

SentimentConfig

Config for setting up sentiments.

Fields
enable_label_sentiment_selection

bool

If set to true, contributors will have the option to select sentiment of the label they selected, to mark it as negative or positive label. Default is false.

SequentialSegment

Start and end position in a sequence (e.g. text segment).

Fields
start

int32

Start position (inclusive).

end

int32

End position (exclusive).

StringAggregationType

Enums
STRING_AGGREGATION_TYPE_UNSPECIFIED
MAJORITY_VOTE Majority vote to aggregate answers.
UNANIMOUS_VOTE Unanimous answers will be adopted.
NO_AGGREGATION Preserve all answers by crowd compute.

TextClassificationAnnotation

Text classification annotation.

Fields
annotation_spec

AnnotationSpec

Label of the text.

TextClassificationConfig

Config for text classification human labeling task.

Fields
allow_multi_label

bool

Optional. If allow_multi_label is true, contributors are able to choose multiple labels for one text segment.

annotation_spec_set

string

Required. Annotation spec set resource name.

sentiment_config

SentimentConfig

Optional. Configs for sentiment selection.

TextEntityExtractionAnnotation

Text entity extraction annotation.

Fields
annotation_spec

AnnotationSpec

Label of the text entities.

sequential_segment

SequentialSegment

Position of the entity.

TextEntityExtractionConfig

Config for text entity extraction human labeling task.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

TextMetadata

Metadata for the text.

Fields
language_code

string

The language of this text, as a BCP-47. Default value is en-US.

TextPayload

Container of information about a piece of text.

Fields
text_content

string

Text content.

TimeSegment

A time period inside of an example that has a time dimension (e.g. video).

Fields
start_time_offset

Duration

Start of the time segment (inclusive), represented as the duration since the example start.

end_time_offset

Duration

End of the time segment (exclusive), represented as the duration since the example start.

Vertex

A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.

Fields
x

int32

X coordinate.

y

int32

Y coordinate.

VideoClassificationAnnotation

Video classification annotation.

Fields
time_segment

TimeSegment

The time segment of the video to which the annotation applies.

annotation_spec

AnnotationSpec

Label of the segment specified by time_segment.

VideoClassificationConfig

Config for video classification human labeling task. Currently two types of video classification are supported: 1. Assign labels on the entire video. 2. Split the video into multiple video clips based on camera shot, and assign labels on each video clip.

Fields
annotation_spec_set_configs[]

AnnotationSpecSetConfig

Required. The list of annotation spec set configs. Since watching a video clip takes much longer time than an image, we support label with multiple AnnotationSpecSet at the same time. Labels in each AnnotationSpecSet will be shown in a group to contributors. Contributors can select one or more (depending on whether to allow multi label) from each group.

apply_shot_detection

bool

Optional. Option to apply shot detection on the video.

AnnotationSpecSetConfig

Annotation spec set with the setting of allowing multi labels or not.

Fields
annotation_spec_set

string

Required. Annotation spec set resource name.

allow_multi_label

bool

Optional. If allow_multi_label is true, contributors are able to choose multiple labels from one annotation spec set.

VideoEventAnnotation

Video event annotation.

Fields
annotation_spec

AnnotationSpec

Label of the event in this annotation.

time_segment

TimeSegment

The time segment of the video to which the annotation applies.

VideoObjectTrackingAnnotation

Video object tracking annotation.

Fields
annotation_spec

AnnotationSpec

Label of the object tracked in this annotation.

time_segment

TimeSegment

The time segment of the video to which object tracking applies.

object_tracking_frames[]

ObjectTrackingFrame

The list of frames where this object track appears.

VideoPayload

Container of information of a video.

Fields
mime_type

string

Video format.

video_uri

string

Video uri from the user bucket.

video_thumbnails[]

VideoThumbnail

The list of video thumbnails.

frame_rate

float

FPS of the video.

signed_uri

string

Signed uri of the video file in the service bucket.

VideoThumbnail

Container of information of a video thumbnail.

Fields
thumbnail

bytes

A byte string of the video frame.

time_offset

Duration

Time offset relative to the beginning of the video, corresponding to the video frame where the thumbnail has been extracted from.

หน้านี้มีประโยชน์ไหม โปรดแสดงความคิดเห็น

ส่งความคิดเห็นเกี่ยวกับ...

หากต้องการความช่วยเหลือ ให้ไปที่หน้าการสนับสนุน