1// Copyright 2020 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.automl.v1beta1;
18
19import "google/cloud/automl/v1beta1/annotation_spec.proto";
20import "google/cloud/automl/v1beta1/classification.proto";
21
22option go_package = "cloud.google.com/go/automl/apiv1beta1/automlpb;automlpb";
23option java_multiple_files = true;
24option java_outer_classname = "ImageProto";
25option java_package = "com.google.cloud.automl.v1beta1";
26option php_namespace = "Google\\Cloud\\AutoMl\\V1beta1";
27option ruby_package = "Google::Cloud::AutoML::V1beta1";
28
29// Dataset metadata that is specific to image classification.
30message ImageClassificationDatasetMetadata {
31  // Required. Type of the classification problem.
32  ClassificationType classification_type = 1;
33}
34
35// Dataset metadata specific to image object detection.
36message ImageObjectDetectionDatasetMetadata {
37
38}
39
40// Model metadata for image classification.
41message ImageClassificationModelMetadata {
42  // Optional. The ID of the `base` model. If it is specified, the new model
43  // will be created based on the `base` model. Otherwise, the new model will be
44  // created from scratch. The `base` model must be in the same
45  // `project` and `location` as the new model to create, and have the same
46  // `model_type`.
47  string base_model_id = 1;
48
49  // Required. The train budget of creating this model, expressed in hours. The
50  // actual `train_cost` will be equal or less than this value.
51  int64 train_budget = 2;
52
53  // Output only. The actual train cost of creating this model, expressed in
54  // hours. If this model is created from a `base` model, the train cost used
55  // to create the `base` model are not included.
56  int64 train_cost = 3;
57
58  // Output only. The reason that this create model operation stopped,
59  // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
60  string stop_reason = 5;
61
62  // Optional. Type of the model. The available values are:
63  // *   `cloud` - Model to be used via prediction calls to AutoML API.
64  //               This is the default value.
65  // *   `mobile-low-latency-1` - A model that, in addition to providing
66  //               prediction via AutoML API, can also be exported (see
67  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
68  //               with TensorFlow afterwards. Expected to have low latency, but
69  //               may have lower prediction quality than other models.
70  // *   `mobile-versatile-1` - A model that, in addition to providing
71  //               prediction via AutoML API, can also be exported (see
72  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
73  //               with TensorFlow afterwards.
74  // *   `mobile-high-accuracy-1` - A model that, in addition to providing
75  //               prediction via AutoML API, can also be exported (see
76  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
77  //               with TensorFlow afterwards.  Expected to have a higher
78  //               latency, but should also have a higher prediction quality
79  //               than other models.
80  // *   `mobile-core-ml-low-latency-1` - A model that, in addition to providing
81  //               prediction via AutoML API, can also be exported (see
82  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core
83  //               ML afterwards. Expected to have low latency, but may have
84  //               lower prediction quality than other models.
85  // *   `mobile-core-ml-versatile-1` - A model that, in addition to providing
86  //               prediction via AutoML API, can also be exported (see
87  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with Core
88  //               ML afterwards.
89  // *   `mobile-core-ml-high-accuracy-1` - A model that, in addition to
90  //               providing prediction via AutoML API, can also be exported
91  //               (see [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile device with
92  //               Core ML afterwards.  Expected to have a higher latency, but
93  //               should also have a higher prediction quality than other
94  //               models.
95  string model_type = 7;
96
97  // Output only. An approximate number of online prediction QPS that can
98  // be supported by this model per each node on which it is deployed.
99  double node_qps = 13;
100
101  // Output only. The number of nodes this model is deployed on. A node is an
102  // abstraction of a machine resource, which can handle online prediction QPS
103  // as given in the node_qps field.
104  int64 node_count = 14;
105}
106
107// Model metadata specific to image object detection.
108message ImageObjectDetectionModelMetadata {
109  // Optional. Type of the model. The available values are:
110  // *   `cloud-high-accuracy-1` - (default) A model to be used via prediction
111  //               calls to AutoML API. Expected to have a higher latency, but
112  //               should also have a higher prediction quality than other
113  //               models.
114  // *   `cloud-low-latency-1` -  A model to be used via prediction
115  //               calls to AutoML API. Expected to have low latency, but may
116  //               have lower prediction quality than other models.
117  // *   `mobile-low-latency-1` - A model that, in addition to providing
118  //               prediction via AutoML API, can also be exported (see
119  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
120  //               with TensorFlow afterwards. Expected to have low latency, but
121  //               may have lower prediction quality than other models.
122  // *   `mobile-versatile-1` - A model that, in addition to providing
123  //               prediction via AutoML API, can also be exported (see
124  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
125  //               with TensorFlow afterwards.
126  // *   `mobile-high-accuracy-1` - A model that, in addition to providing
127  //               prediction via AutoML API, can also be exported (see
128  //               [AutoMl.ExportModel][google.cloud.automl.v1beta1.AutoMl.ExportModel]) and used on a mobile or edge device
129  //               with TensorFlow afterwards.  Expected to have a higher
130  //               latency, but should also have a higher prediction quality
131  //               than other models.
132  string model_type = 1;
133
134  // Output only. The number of nodes this model is deployed on. A node is an
135  // abstraction of a machine resource, which can handle online prediction QPS
136  // as given in the qps_per_node field.
137  int64 node_count = 3;
138
139  // Output only. An approximate number of online prediction QPS that can
140  // be supported by this model per each node on which it is deployed.
141  double node_qps = 4;
142
143  // Output only. The reason that this create model operation stopped,
144  // e.g. `BUDGET_REACHED`, `MODEL_CONVERGED`.
145  string stop_reason = 5;
146
147  // The train budget of creating this model, expressed in milli node
148  // hours i.e. 1,000 value in this field means 1 node hour. The actual
149  // `train_cost` will be equal or less than this value. If further model
150  // training ceases to provide any improvements, it will stop without using
151  // full budget and the stop_reason will be `MODEL_CONVERGED`.
152  // Note, node_hour  = actual_hour * number_of_nodes_invovled.
153  // For model type `cloud-high-accuracy-1`(default) and `cloud-low-latency-1`,
154  // the train budget must be between 20,000 and 900,000 milli node hours,
155  // inclusive. The default value is 216, 000 which represents one day in
156  // wall time.
157  // For model type `mobile-low-latency-1`, `mobile-versatile-1`,
158  // `mobile-high-accuracy-1`, `mobile-core-ml-low-latency-1`,
159  // `mobile-core-ml-versatile-1`, `mobile-core-ml-high-accuracy-1`, the train
160  // budget must be between 1,000 and 100,000 milli node hours, inclusive.
161  // The default value is 24, 000 which represents one day in wall time.
162  int64 train_budget_milli_node_hours = 6;
163
164  // Output only. The actual train cost of creating this model, expressed in
165  // milli node hours, i.e. 1,000 value in this field means 1 node hour.
166  // Guaranteed to not exceed the train budget.
167  int64 train_cost_milli_node_hours = 7;
168}
169
170// Model deployment metadata specific to Image Classification.
171message ImageClassificationModelDeploymentMetadata {
172  // Input only. The number of nodes to deploy the model on. A node is an
173  // abstraction of a machine resource, which can handle online prediction QPS
174  // as given in the model's
175  //
176  // [node_qps][google.cloud.automl.v1beta1.ImageClassificationModelMetadata.node_qps].
177  // Must be between 1 and 100, inclusive on both ends.
178  int64 node_count = 1;
179}
180
181// Model deployment metadata specific to Image Object Detection.
182message ImageObjectDetectionModelDeploymentMetadata {
183  // Input only. The number of nodes to deploy the model on. A node is an
184  // abstraction of a machine resource, which can handle online prediction QPS
185  // as given in the model's
186  //
187  // [qps_per_node][google.cloud.automl.v1beta1.ImageObjectDetectionModelMetadata.qps_per_node].
188  // Must be between 1 and 100, inclusive on both ends.
189  int64 node_count = 1;
190}
191