Package google.cloud.automl.v1beta1

Index

AutoMl

AutoML Server API.

The resource names are assigned by the server. The server never reuses names that it has created after the resources with those names are deleted.

An ID of a resource is the last element of the item's resource name. For projects/{project_id}/locations/{location_id}/datasets/{dataset_id}, then the id for the item is {dataset_id}.

Currently the only supported location_id is "us-central1".

On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted.

CreateDataset

rpc CreateDataset(CreateDatasetRequest) returns (Dataset)

Creates a dataset.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

CreateModel

rpc CreateModel(CreateModelRequest) returns (Operation)

Creates a model. Returns a Model in the response field when it completes. When you create a model, several model evaluations are created for it: a global evaluation, and one evaluation for each annotation spec.

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 (Operation)

Deletes a dataset and all of its contents. Returns empty response in the response field when it completes, and delete_details in the metadata field.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

DeleteModel

rpc DeleteModel(DeleteModelRequest) returns (Operation)

Deletes a model. Returns google.protobuf.Empty in the response field when it completes, and delete_details in the metadata field.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

DeployModel

rpc DeployModel(DeployModelRequest) returns (Operation)

Deploys a model. Not applicable for this product. This product automatically deploys models when they are successfully trained.

Returns an empty response in the response field when it completes.

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 dataset's data to the provided output location. Returns an empty response in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ExportModel

rpc ExportModel(ExportModelRequest) returns (Operation)

Exports a trained, "export-able", model to a user specified Google Cloud Storage location. A model is considered export-able if and only if it has an export format defined for it in

ModelExportOutputConfig.

Returns an empty response in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetAnnotationSpec

rpc GetAnnotationSpec(GetAnnotationSpecRequest) returns (AnnotationSpec)

Gets an annotation spec.

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 a dataset.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetModel

rpc GetModel(GetModelRequest) returns (Model)

Gets a model.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

GetModelEvaluation

rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation)

Gets a model evaluation.

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 a dataset.

For more information, see Importing items into a dataset

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 in a project.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ListModelEvaluations

rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse)

Lists model evaluations.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

ListModels

rpc ListModels(ListModelsRequest) returns (ListModelsResponse)

Lists models.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

UndeployModel

rpc UndeployModel(UndeployModelRequest) returns (Operation)

Removes a deployed model. Not applicable for this product. This product automatically removes deployed models that are deleted.

Returns an empty response in the response field when it completes.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

UpdateDataset

rpc UpdateDataset(UpdateDatasetRequest) returns (Dataset)

Updates a dataset.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

PredictionService

AutoML Prediction API.

On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted.

Predict

rpc Predict(PredictRequest) returns (PredictResponse)

Perform an online prediction. The prediction result will be directly returned in the response.

You can call the predict method for an image in .JPEG, .GIF or .PNG format up to 30MB in size.

See Annotating images for more details.

Authorization Scopes

Requires the following OAuth scope:

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

For more information, see the Authentication Overview.

AnnotationPayload

Contains annotation information that is relevant to AutoML.

Fields
annotation_spec_id

string

Output only . The resource ID of the annotation spec that this annotation pertains to. The annotation spec comes from either an ancestor dataset, or the dataset that was used to train the model in use.

display_name

string

Output only. The value of display_name when the model was trained. Because this field returns a value at model training time, for different models trained using the same dataset, the returned value could be different as model owner could update the display_name between any two model training.

Union field detail. Output only . Additional information about the annotation specific to the AutoML domain. detail can be only one of the following:
classification

ClassificationAnnotation

Annotation details for classification predictions.

image_segmentation

ImageSegmentationAnnotation

Annotation details for image segmentation.

text_sentiment

TextSentimentAnnotation

Annotation details for text sentiment.

AnnotationSpec

A definition of an annotation.

Fields
name

string

Output only. Resource name of the annotation spec. Form:

'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'

display_name

string

Required. The name of the annotation spec to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.

category

int32

This field is required in image segmentation and is only useful in it. In

category_mask, each pixel represents the category of the pixel in original image. This field associates each category_mask with one AnnotationSpec. No two AnnotationSpecs in a dataset can have the same category_mask. Valid range for categories is 1 to 254 inclusive. Also, 0 and 255 are also allowed where 0 is assumed to be background while 255 signifies unknown regions.

example_count

int32

Output only. The number of examples in the parent dataset labeled by the annotation spec.

BigQueryDestination

The BigQuery location for the output content.

Fields
output_uri

string

Required. BigQuery URI to a project, up to 2000 characters long. Accepted forms: * BigQuery path e.g. bq://projectId

ClassificationAnnotation

Contains annotation details specific to classification.

Fields
score

float

Output only. A confidence estimate between 0.0 and 1.0. A higher value means greater confidence that the annotation is positive. If a user approves an annotation as negative or positive, the score value remains unchanged. If a user creates an annotation, the score is 0 for negative or 1 for positive.

ClassificationEvaluationMetrics

Model evaluation metrics for classification problems. For information on the prediction type, see PredictRequest.params.

Fields
au_prc

float

Output only. The Area Under Precision-Recall Curve metric. Micro-averaged for the overall evaluation.

base_au_prc
(deprecated)

float

Output only. The Area Under Precision-Recall Curve metric based on priors. Micro-averaged for the overall evaluation. Deprecated.

au_roc

float

Output only. The Area Under Receiver Operating Characteristic curve metric. Micro-averaged for the overall evaluation.

log_loss

float

Output only. The Log Loss metric.

confidence_metrics_entry[]

ConfidenceMetricsEntry

Output only. Metrics for each confidence_threshold in 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and position_threshold = INT32_MAX_VALUE. ROC and precision-recall curves, and other aggregated metrics are derived from them. The confidence metrics entries may also be supplied for additional values of position_threshold, but from these no aggregated metrics are computed.

confusion_matrix

ConfusionMatrix

Output only. Confusion matrix of the evaluation. Only set for MULTICLASS classification problems where number of labels is no more than 10. Only set for model level evaluation, not for evaluation per label.

annotation_spec_id[]

string

Output only. The annotation spec ids used for this evaluation.

ConfidenceMetricsEntry

Metrics for a single confidence threshold.

Fields
confidence_threshold

float

Output only. Metrics are computed with an assumption that the model never returns predictions with score lower than this value.

position_threshold

int32

Output only. Metrics are computed with an assumption that the model always returns at most this many predictions (ordered by their score, descendingly), but they all still need to meet the confidence_threshold.

recall

float

Output only. Recall (True Positive Rate) for the given confidence threshold.

precision

float

Output only. Precision for the given confidence threshold.

false_positive_rate

float

Output only. False Positive Rate for the given confidence threshold.

f1_score

float

Output only. The harmonic mean of recall and precision.

recall_at1

float

Output only. The Recall (True Positive Rate) when only considering the label that has the highest prediction score and not below the confidence threshold for each example.

precision_at1

float

Output only. The precision when only considering the label that has the highest prediction score and not below the confidence threshold for each example.

false_positive_rate_at1

float

Output only. The False Positive Rate when only considering the label that has the highest prediction score and not below the confidence threshold for each example.

f1_score_at1

float

Output only. The harmonic mean of recall_at1 and precision_at1.

true_positive_count

int64

Output only. The number of model created labels that match a ground truth label.

false_positive_count

int64

Output only. The number of model created labels that do not match a ground truth label.

false_negative_count

int64

Output only. The number of ground truth labels that are not matched by a model created label.

true_negative_count

int64

Output only. The number of labels that were not created by the model, but if they would, they would not match a ground truth label.

ConfusionMatrix

Confusion matrix of the model running the classification.

Fields
annotation_spec_id[]

string

Output only. IDs of the annotation specs used in the confusion matrix.

row[]

Row

Output only. Rows in the confusion matrix. The number of rows is equal to the size of annotation_spec_id. row[i].value[j] is the number of examples that have ground truth of the annotation_spec_id[i] and are predicted as annotation_spec_id[j] by the model being evaluated.

Row

Output only. A row in the confusion matrix.

Fields
example_count[]

int32

Output only. Value of the specific cell in the confusion matrix. The number of values each row has (i.e. the length of the row) is equal to the length of the annotation_spec_id field or, if that one is not populated, length of the display_name field.

ClassificationType

Type of the classification problem.

Enums
CLASSIFICATION_TYPE_UNSPECIFIED An un-set value of this enum.
MULTICLASS At most one label is allowed per example.
MULTILABEL Multiple labels are allowed for one example.

CreateDatasetRequest

Request message for AutoMl.CreateDataset.

Fields
parent

string

The resource name of the project to create the dataset for.

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

  • automl.datasets.create

dataset

Dataset

The dataset to create.

CreateModelOperationMetadata

Details of CreateModel operation.

CreateModelRequest

Request message for AutoMl.CreateModel.

Fields
parent

string

Resource name of the parent project where the model is being created.

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

  • automl.models.create

model

Model

The model to create.

Dataset

A workspace for solving a single, particular machine learning (ML) problem. A workspace contains examples that may be annotated.

Fields
name

string

Output only. The resource name of the dataset. Form: projects/{project_id}/locations/{location_id}/datasets/{dataset_id}

display_name

string

Required. The name of the dataset to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9.

description

string

User-provided description of the dataset. The description can be up to 25000 characters long.

example_count

int32

Output only. The number of examples in the dataset.

create_time

Timestamp

Output only. Timestamp when this dataset was created.

etag

string

Used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens.

Union field dataset_metadata. Required. The dataset metadata that is specific to the problem type. dataset_metadata can be only one of the following:
image_classification_dataset_metadata

ImageClassificationDatasetMetadata

Metadata for a dataset used for image classification.

text_sentiment_dataset_metadata

TextSentimentDatasetMetadata

Metadata for a dataset used for text sentiment.

DeleteDatasetRequest

Request message for AutoMl.DeleteDataset.

Fields
name

string

The resource name of the dataset to delete.

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

  • automl.datasets.delete

DeleteModelRequest

Request message for AutoMl.DeleteModel.

Fields
name

string

Resource name of the model being deleted.

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

  • automl.models.delete

DeleteOperationMetadata

Details of operations that perform deletes of any entities.

DeployModelOperationMetadata

Details of DeployModel operation.

DeployModelRequest

Request message for AutoMl.DeployModel.

Fields
name

string

Resource name of the model to deploy.

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

  • automl.models.deploy

Document

A structured text document e.g. a PDF.

Fields
input_config

DocumentInputConfig

An input config specifying the content of the document.

DocumentInputConfig

Input configuration of a Document.

Fields
gcs_source

GcsSource

The Google Cloud Storage location of the document file. Only a single path should be given. Max supported size: 512MB. Supported extensions: .PDF.

ExamplePayload

Example data used for training or prediction.

Fields
Union field payload. Required. Input only. The example data. payload can be only one of the following:
image

Image

Example image.

document

Document

Example document.

row

Row

Example relational table row.

ExportDataOperationMetadata

Details of ExportData operation.

Fields
output_info

ExportDataOutputInfo

Output only. Information further describing this export data's output.

ExportDataOutputInfo

Further describes this export data's output. Supplements OutputConfig.

Fields
Union field output_location. The output location to which the exported data is written. output_location can be only one of the following:
gcs_output_directory

string

The full path of the Google Cloud Storage directory created, into which the exported data is written.

bigquery_output_dataset

string

The path of the BigQuery dataset created, in bq://projectId.bqDatasetId format, into which the exported data is written.

ExportDataRequest

Request message for AutoMl.ExportData.

Fields
name

string

Required. The resource name of the dataset.

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

  • automl.datasets.export

output_config

OutputConfig

Required. The desired output location.

ExportEvaluatedExamplesOperationMetadata

Details of EvaluatedExamples operation.

Fields
output_info

ExportEvaluatedExamplesOutputInfo

Output only. Information further describing the output of this evaluated examples export.

ExportEvaluatedExamplesOutputInfo

Further describes the output of the evaluated examples export. Supplements

ExportEvaluatedExamplesOutputConfig.

Fields
bigquery_output_dataset

string

The path of the BigQuery dataset created, in bq://projectId.bqDatasetId format, into which the output of export evaluated examples is written.

ExportModelOperationMetadata

Details of ExportModel operation.

Fields
output_info

ExportModelOutputInfo

Output only. Information further describing the output of this model export.

ExportModelOutputInfo

Further describes the output of model export. Supplements

ModelExportOutputConfig.

Fields
gcs_output_directory

string

The full path of the Google Cloud Storage directory created, into which the model will be exported.

ExportModelRequest

Request message for AutoMl.ExportModel. Models need to be enabled for exporting, otherwise an error code will be returned.

Fields
name

string

Required. The resource name of the model to export.

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

  • automl.models.export

output_config

ModelExportOutputConfig

Required. The desired output location and configuration.

GcrDestination

The GCR location where the image must be pushed to.

Fields
output_uri

string

Required. Google Contained Registry URI of the new image, up to 2000 characters long. See

https: //cloud.google.com/container-registry/do // cs/pushing-and-pulling#pushing_an_image_to_a_registry Accepted forms: * [HOSTNAME]/[PROJECT-ID]/[IMAGE] * [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]

The requesting user must have permission to push images the project.

GcsDestination

The Google Cloud Storage location where the output is to be written to.

Fields
output_uri_prefix

string

Required. Google Cloud Storage URI to output directory, up to 2000 characters long. Accepted forms: * Prefix path: gs://bucket/directory The requesting user must have write permission to the bucket. The directory is created if it doesn't exist.

GcsSource

The Google Cloud Storage location for the input content.

Fields
input_uris[]

string

Required. Google Cloud Storage URIs to input files, up to 2000 characters long. Accepted forms: * Full object path, e.g. gs://bucket/directory/object.csv

GetAnnotationSpecRequest

Request message for AutoMl.GetAnnotationSpec.

Fields
name

string

The resource name of the annotation spec to retrieve.

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

  • automl.annotationSpecs.get

GetDatasetRequest

Request message for AutoMl.GetDataset.

Fields
name

string

The resource name of the dataset to retrieve.

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

  • automl.datasets.get

GetModelEvaluationRequest

Request message for AutoMl.GetModelEvaluation.

Fields
name

string

Resource name for the model evaluation.

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

  • automl.modelEvaluations.get

GetModelRequest

Request message for AutoMl.GetModel.

Fields
name

string

Resource name of the model.

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

  • automl.models.get

Image

A representation of an image. Only images up to 30MB in size are supported.

Fields
thumbnail_uri

string

Output only. HTTP URI to the thumbnail image.

content_uri

string

Output only. HTTP URI to the normalized image.

Union field data. Input only. The data representing the image. For predict calls, you must set image_bytes. data can be only one of the following:
image_bytes

bytes

Image content represented as a stream of bytes. Note: As with all bytes fields, protobuffers use a pure binary representation, whereas JSON representations use base64.

input_config

InputConfig

An input config specifying the content of the image.

ImageClassificationDatasetMetadata

Dataset metadata that is specific to image classification.

Fields
classification_type

ClassificationType

Required. Type of the classification problem.

ImageClassificationModelMetadata

Model metadata for image classification.

Fields
base_model_id

string

Optional. The ID of the base model. If it is specified, the new model will be created based on the base model. Otherwise, the new model will be created from scratch. The base model must be in the same project and location as the new model to create, and have the same model_type.

train_budget

int64

Required. The train budget of creating this model, expressed in hours. The actual train_cost will be equal or less than this value.

train_cost

int64

Output only. The actual train cost of creating this model, expressed in hours. If this model is created from a base model, the train cost used to create the base model are not included.

stop_reason

string

Output only. The reason that this create model operation stopped, e.g. BUDGET_REACHED, MODEL_CONVERGED.

model_type

string

Optional. Type of the model. The available values are: * cloud - Model to be used via prediction calls to AutoML API. This is the default value. * mobile-low-latency-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have low latency, but may have lower prediction quality than other models. * mobile-versatile-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. * mobile-high-accuracy-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile or edge device with TensorFlow afterwards. Expected to have a higher latency, but should also have a higher prediction quality than other models. * mobile-core-ml-low-latency-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. Expected to have low latency, but may have lower prediction quality than other models. * mobile-core-ml-versatile-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. * mobile-core-ml-high-accuracy-1 - A model that, in addition to providing prediction via AutoML API, can also be exported (see AutoMl.ExportModel) and used on a mobile device with Core ML afterwards. Expected to have a higher latency, but should also have a higher prediction quality than other models.

ImageSegmentationAnnotation

Annotation details for image segmentation.

Fields
confidence_mask

Image

Output only. One channel image which is encoded as an 8bit lossless PNG. The size of the image will be the same as the original image. For a specific pixel, darker color means less confidence in correctness of the cateogry in the category_meask for the corresponding pixel. Black means no confidence and white means full confidence.

category_mask

Image

Required. One channel image which is encoded as an 8bit lossless PNG. Each pixel in the image mask represents the category which the pixel in the original image was predicted to belong to. For prediction result, the category must corresponds to one of

[thin_annotation_specs'][google.cloud.automl.v1beta1.ImageSegmentationModelMetadata.thin_annotation_specs] [category][google.cloud.automl.v1beta1.ThinAnnotationSpec.category] in

image_segmentation_model_metadata. The model will choose the most likely category and if none of the categories reach the confidence threshold, the pixel will be marked as background.

ImageSegmentationModelMetadata

Model metadata specific to Image Segmentation.

Fields
annotation_spec[]

AnnotationSpec

Output only. The snapshot of datasets's annotation specs. Only 3 fields are populated: name - Output only. display_name - Output only. class - Output only.

ImportDataOperationMetadata

Details of ImportData operation.

ImportDataRequest

Request message for AutoMl.ImportData.

Fields
name

string

Required. Dataset name. Dataset must already exist. All imported annotations and examples will be added.

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

  • automl.datasets.import

input_config

InputConfig

Required. The desired input location and its domain specific semantics, if any.

InputConfig

Input configuration for ImportData action.

See Preparing your training data for more information.

Errors

If any of the provided CSV files can't be parsed or if more than certain percent of CSV rows cannot be processed then the operation fails and nothing is imported. Regardless of overall success or failure the per-row failures, up to a certain count cap, will be listed in Operation.metadata.partial_failures.

Fields
params

map<string, string>

Additional domain-specific parameters describing the semantic of the imported data, any string must be up to 25000 characters long.

gcs_source

GcsSource

The Google Cloud Storage location for the input content.

ListDatasetsRequest

Request message for AutoMl.ListDatasets.

Fields
parent

string

The resource name of the project from which to list datasets.

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

  • automl.datasets.list

filter

string

An expression for filtering the results of the request.

  • dataset_metadata: test for existence of metadata.

An example of using the filter is:

  • image_classification_dataset_metadata:* --> The dataset has image_classification_dataset_metadata.

  • regex(display_name, "^A") -> The dataset's display name starts with "A"

page_size

int32

Requested page size. Server may return fewer results than requested. If unspecified, server will pick a default size.

page_token

string

A token identifying a page of results for the server to return Typically obtained via ListDatasetsResponse.next_page_token of the previous AutoMl.ListDatasets call.

ListDatasetsResponse

Response message for AutoMl.ListDatasets.

Fields
datasets[]

Dataset

The datasets read.

next_page_token

string

A token to retrieve next page of results. Pass to ListDatasetsRequest.page_token to obtain that page.

ListModelEvaluationsRequest

Request message for AutoMl.ListModelEvaluations.

Fields
parent

string

Resource name of the model to list the model evaluations for. If modelId is set as "-", this will list model evaluations from across all models of the parent location.

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

  • automl.modelEvaluations.list

filter

string

An expression for filtering the results of the request.

  • annotation_spec_id - for =, != or existence. See example below for the last.

Some examples of using the filter are:

  • annotation_spec_id!=4 --> The model evaluation was done for annotation spec with ID different than 4.
  • NOT annotation_spec_id:* --> The model evaluation was done for aggregate of all annotation specs.

page_size

int32

Requested page size.

page_token

string

A token identifying a page of results for the server to return. Typically obtained via ListModelEvaluationsResponse.next_page_token of the previous AutoMl.ListModelEvaluations call.

ListModelEvaluationsResponse

Response message for AutoMl.ListModelEvaluations.

Fields
model_evaluation[]

ModelEvaluation

List of model evaluations in the requested page.

next_page_token

string

A token to retrieve next page of results. Pass to the ListModelEvaluationsRequest.page_token field of a new AutoMl.ListModelEvaluations request to obtain that page.

ListModelsRequest

Request message for AutoMl.ListModels.

Fields
parent

string

Resource name of the project, from which to list the models.

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

  • automl.models.list

filter

string

An expression for filtering the results of the request.

  • model_metadata: test for existence of metadata.

  • dataset_id: = or != a dataset ID.

Some examples of using the filter are:

  • image_classification_model_metadata:* --> The model has image_classification_model_metadata.

  • dataset_id=5 --> The model was created from a dataset with an ID of 5.

  • regex(display_name, "^A") -> The models's display name starts with "A".

page_size

int32

Requested page size.

page_token

string

A token identifying a page of results for the server to return Typically obtained via ListModelsResponse.next_page_token of the previous AutoMl.ListModels call.

ListModelsResponse

Response message for AutoMl.ListModels.

Fields
model[]

Model

List of models in the requested page.

next_page_token

string

A token to retrieve next page of results. Pass to ListModelsRequest.page_token to obtain that page.

Model

API proto representing a trained machine learning model.

Fields
name

string

Output only. Resource name of the model. Format: projects/{project_id}/locations/{location_id}/models/{model_id}

display_name

string

Required. The name of the model to show in the interface. The name can be up to 32 characters long and can consist only of ASCII Latin letters A-Z and a-z, underscores (_), and ASCII digits 0-9. It must start with a letter.

dataset_id

string

Required. The resource ID of the dataset used to create the model. The dataset must come from the same ancestor project and location.

create_time

Timestamp

Output only. Timestamp when the model training finished and can be used for prediction.

update_time

Timestamp

Output only. Timestamp when this model was last updated.

deployment_state

DeploymentState

Output only. Deployment state of the model. A model can only serve prediction requests after it gets deployed.

Union field model_metadata. Required. The model metadata that is specific to the problem type. Must match the metadata type of the dataset used to train the model. model_metadata can be only one of the following:
image_classification_model_metadata

ImageClassificationModelMetadata

Metadata for image classification models.

image_segmentation_model_metadata

ImageSegmentationModelMetadata

Metadata for image segmentation models.

text_sentiment_model_metadata

TextSentimentModelMetadata

Metadata for text sentiment models.

DeploymentState

Deployment state of the model.

Enums
DEPLOYMENT_STATE_UNSPECIFIED Should not be used, an un-set enum has this value by default.
DEPLOYED Model is deployed.
UNDEPLOYED Model is not deployed.

ModelEvaluation

Evaluation results of a model.

Fields
name

string

Output only. Resource name of the model evaluation. Format:

projects/{project_id}/locations/{location_id}/models/{model_id}/modelEvaluations/{model_evaluation_id}

annotation_spec_id

string

Output only. The ID of the annotation spec that the model evaluation applies to. The The ID is empty for the overall model evaluation.

NOTE: Currently there is no way to obtain the display_name of the annotation spec from its ID. To see the display_names, review the model evaluations in the AutoML UI.

display_name

string

Output only. The value of display_name at the moment when the model was trained. Because this field returns a value at model training time, for different models trained from the same dataset, the values may differ, since display names could had been changed between the two model's trainings.

The display_name is empty for the overall model evaluation.

create_time

Timestamp

Output only. Timestamp when this model evaluation was created.

evaluated_example_count

int32

Output only. The number of examples used for model evaluation, i.e. for which ground truth from time of model creation is compared against the predicted annotations created by the model. For overall ModelEvaluation (i.e. with annotation_spec_id not set) this is the total number of all examples used for evaluation. Otherwise, this is the count of examples that according to the ground truth were annotated by the

annotation_spec_id.

Union field metrics. Output only. Problem type specific evaluation metrics. metrics can be only one of the following:
classification_evaluation_metrics

ClassificationEvaluationMetrics

Evaluation metrics for classification models.

text_sentiment_evaluation_metrics

TextSentimentEvaluationMetrics

Evaluation metrics for text sentiment models.

ModelExportOutputConfig

Output configuration for ModelExport Action.

Fields
model_format

string

The format in which the model must be exported. The available, and default, formats depend on the problem and model type (if given problem and type combination doesn't have a format listed, it means its models are not exportable):

  • For Image Classification mobile-low-latency-1, mobile-versatile-1, mobile-high-accuracy-1: "tflite" (default), "edgetpu_tflite", "tf_saved_model", "docker".

  • For Image Classification mobile-core-ml-low-latency-1, mobile-core-ml-versatile-1, mobile-core-ml-high-accuracy-1: "core_ml" (default). Formats description:

  • tflite - Used for Android mobile devices.

  • edgetpu_tflite - Used for Edge TPU devices.

  • tf_saved_model - A tensorflow model in SavedModel format.

  • docker - Used for Docker containers. Use the params field to customize the container. The container is verified to work correctly on ubuntu 16.04 operating system. See more at [containers quickstart](https: //cloud.google.com/vision/automl/docs/containers-gcs-quickstart)

  • core_ml - Used for iOS mobile devices.

params

map<string, string>

Additional model-type and format specific parameters describing the requirements for the to be exported model files, any string must be up to 25000 characters long.

  • For docker format: cpu_architecture - (string) "x86_64" (default). gpu_architecture - (string) "none" (default), "nvidia".

Union field destination. Required. The destination of the output. destination can be only one of the following:
gcs_destination

GcsDestination

The Google Cloud Storage location where the model is to be written to. This location may only be set for the following model formats: "tflite", "edgetpu_tflite", "core_ml", "docker".

Under the directory given as the destination a new one with name "model-export--", where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format, will be created. Inside the model and any of its supporting files will be written, as described

[here](https: //cloud.google.com/vision/automl/alpha/d // ocs/predict#deployment_to_devices).

gcr_destination

GcrDestination

The GCR location where model image is to be pushed to. This location may only be set for the following model formats: "docker".

The model image will be created under the given URI.

OperationMetadata

Metadata used across all long running operations returned by AutoML API.

Fields
progress_percent

int32

Output only. Progress of operation. Range: [0, 100]. Not used currently.

partial_failures[]

Status

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

create_time

Timestamp

Output only. Time when the operation was created.

update_time

Timestamp

Output only. Time when the operation was updated for the last time.

Union field details. Ouptut only. Details of specific operation. Even if this field is empty, the presence allows to distinguish different types of operations. details can be only one of the following:
delete_details

DeleteOperationMetadata

Details of a Delete operation.

deploy_model_details

DeployModelOperationMetadata

Details of a DeployModel operation.

undeploy_model_details

UndeployModelOperationMetadata

Details of an UndeployModel operation.

create_model_details

CreateModelOperationMetadata

Details of CreateModel operation.

import_data_details

ImportDataOperationMetadata

Details of ImportData operation.

export_data_details

ExportDataOperationMetadata

Details of ExportData operation.

export_model_details

ExportModelOperationMetadata

Details of ExportModel operation.

export_evaluated_examples_details

ExportEvaluatedExamplesOperationMetadata

Details of ExportEvaluatedExamples operation.

OutputConfig

Output configuration for ExportData. Does not apply to this product.

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

GcsDestination

The Google Cloud Storage location where the output from the predict command is to be written to. Does not apply for this product.

bigquery_destination

BigQueryDestination

The BigQuery location where the output is to be written to.

PredictRequest

Request message for PredictionService.Predict.

Fields
name

string

Name of the model requested to serve the prediction.

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

  • automl.models.predict

payload

ExamplePayload

Required. Payload to perform a prediction on. The payload must match the problem type that the model was trained to solve.

params

map<string, string>

Additional domain-specific parameters, any string must be up to 25000 characters long.

You can set the following fields:

  • score_threshold - (float) A value from 0.0 to 1.0. When the model makes predictions for an image, it will only produce results that have at least this confidence score. The default is 0.5.

See Annotating images for more details.

PredictResponse

Response message for PredictionService.Predict.

Fields
payload[]

AnnotationPayload

Prediction result.

metadata

map<string, string>

Additional domain-specific prediction response metadata.

Row

A representation of a row in a relational table.

Fields
column_spec_ids[]

string

The resource IDs of the column specs describing the columns of the row. If set must contain, but possibly in a different order, all input feature

column_spec_ids of the Model this row is being passed to. Note: The below values field must match order of this field, if this field is set.

values[]

Value

Required. The values of the row cells, given in the same order as the column_spec_ids, or, if not set, then in the same order as input feature

column_specs of the Model this row is being passed to.

TextSentimentAnnotation

Contains annotation details specific to text sentiment.

Fields
sentiment

int32

Output only. The sentiment with the semantic, as given to the AutoMl.ImportData when populating the dataset from which the model used for the prediction had been trained. The sentiment values are between 0 and Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive), with higher value meaning more positive sentiment. They are completely relative, i.e. 0 means least positive sentiment and sentiment_max means the most positive from the sentiments present in the train data. Therefore e.g. if train data had only negative sentiment, then sentiment_max, would be still negative (although least negative). The sentiment shouldn't be confused with "score" or "magnitude" from the previous Natural Language Sentiment Analysis API.

TextSentimentDatasetMetadata

Dataset metadata for text sentiment.

Fields
sentiment_max

int32

Required. A sentiment is expressed as an integer ordinal, where higher value means a more positive sentiment. The range of sentiments that will be used is between 0 and sentiment_max (inclusive on both ends), and all the values in the range must be represented in the dataset before a model can be created. sentiment_max value must be between 1 and 10 (inclusive).

TextSentimentEvaluationMetrics

Model evaluation metrics for text sentiment problems.

Fields
precision

float

Output only. Precision.

recall

float

Output only. Recall.

f1_score

float

Output only. The harmonic mean of recall and precision.

mean_absolute_error

float

Output only. Mean absolute error. Only set for the overall model evaluation, not for evaluation of a single annotation spec.

mean_squared_error

float

Output only. Mean squared error. Only set for the overall model evaluation, not for evaluation of a single annotation spec.

linear_kappa

float

Output only. Linear weighted kappa. Only set for the overall model evaluation, not for evaluation of a single annotation spec.

quadratic_kappa

float

Output only. Quadratic weighted kappa. Only set for the overall model evaluation, not for evaluation of a single annotation spec.

confusion_matrix

ConfusionMatrix

Output only. Confusion matrix of the evaluation. Only set for the overall model evaluation, not for evaluation of a single annotation spec.

annotation_spec_id[]
(deprecated)

string

Output only. The annotation spec ids used for this evaluation. Deprecated .

TextSentimentModelMetadata

Model metadata that is specific to text sentiment.

UndeployModelOperationMetadata

Details of UndeployModel operation.

UndeployModelRequest

Request message for AutoMl.UndeployModel.

Fields
name

string

Resource name of the model to undeploy.

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

  • automl.models.undeploy

UpdateDatasetRequest

Request message for AutoMl.UpdateDataset

Fields
dataset

Dataset

The dataset which replaces the resource on the server.

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

  • automl.datasets.update

update_mask

FieldMask

The update mask applies to the resource. For the FieldMask definition, see

https: //developers.google.com/protocol-buffers // /docs/reference/google.protobuf#fieldmask

Was this page helpful? Let us know how we did:

Send feedback about...

Cloud AutoML Vision
Need help? Visit our support page.