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