Skip to content

Commit

Permalink
chore: added proto annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored Mar 5, 2020
1 parent d1b7990 commit ff9335e
Show file tree
Hide file tree
Showing 35 changed files with 2,498 additions and 921 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,12 +11,12 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.automl.v1;

import "google/api/resource.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.AutoML.V1";
Expand All @@ -28,16 +28,19 @@ option ruby_package = "Google::Cloud::AutoML::V1";

// A definition of an annotation spec.
message AnnotationSpec {
option (google.api.resource) = {
type: "automl.googleapis.com/AnnotationSpec"
pattern: "projects/{project}/locations/{location}/datasets/{dataset}/annotationSpecs/{annotation_spec}"
};

// Output only. Resource name of the annotation spec.
// Form:
//
// 'projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/annotationSpecs/{annotation_spec_id}'
string name = 1;

// Required.
// The name of the annotation spec to show in the interface. The name can be
// Required. The name of the annotation spec to show in the interface. The name can be
// up to 32 characters long and must match the regexp `[a-zA-Z0-9_]+`.
// (_), and ASCII digits 0-9.
string display_name = 2;

// Output only. The number of examples in the parent dataset
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down Expand Up @@ -50,6 +49,8 @@ message ClassificationAnnotation {
}

// Model evaluation metrics for classification problems.
// Note: For Video Classification this metrics only describe quality of the
// Video Classification predictions of "segment_classification" type.
message ClassificationEvaluationMetrics {
// Metrics for a single confidence threshold.
message ConfidenceMetricsEntry {
Expand Down Expand Up @@ -90,10 +91,7 @@ message ClassificationEvaluationMetrics {
// for each example.
float false_positive_rate_at1 = 9;

// Output only. The harmonic mean of
// [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1]
// and
// [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
// Output only. The harmonic mean of [recall_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.recall_at1] and [precision_at1][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfidenceMetricsEntry.precision_at1].
float f1_score_at1 = 7;

// Output only. The number of model created labels that match a ground truth
Expand All @@ -120,17 +118,24 @@ message ClassificationEvaluationMetrics {
// 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][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name]
// field.
// populated, length of the [display_name][google.cloud.automl.v1.ClassificationEvaluationMetrics.ConfusionMatrix.display_name] field.
repeated int32 example_count = 1;
}

// Output only. IDs of the annotation specs used in the confusion matrix.
// For Tables CLASSIFICATION
//
// [prediction_type][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type]
// only list of [annotation_spec_display_name-s][] is populated.
repeated string annotation_spec_id = 1;

// Output only. Display name of the annotation specs used in the confusion
// matrix, as they were at the moment of the evaluation.
// matrix, as they were at the moment of the evaluation. For Tables
// CLASSIFICATION
//
// [prediction_type-s][google.cloud.automl.v1p1beta.TablesModelMetadata.prediction_type],
// distinct values of the target column at the moment of the model
// evaluation are populated here.
repeated string display_name = 3;

// Output only. Rows in the confusion matrix. The number of rows is equal to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,19 +11,18 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.automl.v1;

import "google/api/annotations.proto";
import "google/cloud/automl/v1/geometry.proto";
import "google/cloud/automl/v1/io.proto";
import "google/cloud/automl/v1/text_segment.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/struct.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.AutoML.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
Expand All @@ -36,6 +35,7 @@ option ruby_package = "Google::Cloud::AutoML::V1";
// Only images up to 30MB in size are supported.
message Image {
// Input only. The data representing the image.
// For Predict calls [image_bytes][google.cloud.automl.v1.Image.image_bytes] must be set .
oneof data {
// Image content represented as a stream of bytes.
// Note: As with all `bytes` fields, protobuffers use a pure binary
Expand All @@ -53,11 +53,9 @@ message TextSnippet {
// characters long.
string content = 1;

// Optional. The format of
// [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only
// two allowed values are "text/html" and "text/plain". If left blank, the
// format is automatically determined from the type of the uploaded
// [content][google.cloud.automl.v1.TextSnippet.content].
// Optional. The format of [content][google.cloud.automl.v1.TextSnippet.content]. Currently the only two allowed
// values are "text/html" and "text/plain". If left blank, the format is
// automatically determined from the type of the uploaded [content][google.cloud.automl.v1.TextSnippet.content].
string mime_type = 2;

// Output only. HTTP URI where you can download the content.
Expand Down Expand Up @@ -93,9 +91,7 @@ message DocumentDimensions {

// A structured text document e.g. a PDF.
message Document {
// Describes the layout information of a
// [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the
// document.
// Describes the layout information of a [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the document.
message Layout {
// The type of TextSegment in the context of the original document.
enum TextSegmentType {
Expand Down Expand Up @@ -141,29 +137,25 @@ message Document {
}

// Text Segment that represents a segment in
// [document_text][google.cloud.automl.v1.Document.document_text].
// [document_text][google.cloud.automl.v1p1beta.Document.document_text].
TextSegment text_segment = 1;

// Page number of the
// [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
// the original document, starts from 1.
// Page number of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the original document, starts
// from 1.
int32 page_number = 2;

// The position of the
// [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
// the page. Contains exactly 4
// The position of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in the page.
// Contains exactly 4
//
// [normalized_vertices][google.cloud.automl.v1.BoundingPoly.normalized_vertices]
// [normalized_vertices][google.cloud.automl.v1p1beta.BoundingPoly.normalized_vertices]
// and they are connected by edges in the order provided, which will
// represent a rectangle parallel to the frame. The
// [NormalizedVertex-s][google.cloud.automl.v1.NormalizedVertex] are
// [NormalizedVertex-s][google.cloud.automl.v1p1beta.NormalizedVertex] are
// relative to the page.
// Coordinates are based on top-left as point (0,0).
BoundingPoly bounding_poly = 3;

// The type of the
// [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in
// document.
// The type of the [text_segment][google.cloud.automl.v1.Document.Layout.text_segment] in document.
TextSegmentType text_segment_type = 4;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand All @@ -34,6 +33,11 @@ option ruby_package = "Google::Cloud::AutoML::V1";
// A workspace for solving a single, particular machine learning (ML) problem.
// A workspace contains examples that may be annotated.
message Dataset {
option (google.api.resource) = {
type: "automl.googleapis.com/Dataset"
pattern: "projects/{project}/locations/{location}/datasets/{dataset}"
};

// Required.
// The dataset metadata that is specific to the problem type.
oneof dataset_metadata {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,15 +11,14 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

package google.cloud.automl.v1;

import "google/api/annotations.proto";
import "google/cloud/automl/v1/geometry.proto";
import "google/protobuf/duration.proto";
import "google/api/annotations.proto";

option csharp_namespace = "Google.Cloud.AutoML.V1";
option go_package = "google.golang.org/genproto/googleapis/cloud/automl/v1;automl";
Expand All @@ -33,8 +32,8 @@ message ImageObjectDetectionAnnotation {
// Output only. The rectangle representing the object location.
BoundingPoly bounding_box = 1;

// Output only. The confidence that this annotation is positive for the parent
// example, value in [0, 1], higher means higher positivity confidence.
// Output only. The confidence that this annotation is positive for the parent example,
// value in [0, 1], higher means higher positivity confidence.
float score = 2;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Google LLC.
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -11,7 +11,6 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

syntax = "proto3";

Expand Down
Loading

0 comments on commit ff9335e

Please sign in to comment.