xref: /aosp_15_r20/external/googleapis/google/cloud/automl/v1/detection.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1*d5c09012SAndroid Build Coastguard Worker// Copyright 2021 Google LLC
2*d5c09012SAndroid Build Coastguard Worker//
3*d5c09012SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License");
4*d5c09012SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License.
5*d5c09012SAndroid Build Coastguard Worker// You may obtain a copy of the License at
6*d5c09012SAndroid Build Coastguard Worker//
7*d5c09012SAndroid Build Coastguard Worker//     http://www.apache.org/licenses/LICENSE-2.0
8*d5c09012SAndroid Build Coastguard Worker//
9*d5c09012SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software
10*d5c09012SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS,
11*d5c09012SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*d5c09012SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and
13*d5c09012SAndroid Build Coastguard Worker// limitations under the License.
14*d5c09012SAndroid Build Coastguard Worker
15*d5c09012SAndroid Build Coastguard Workersyntax = "proto3";
16*d5c09012SAndroid Build Coastguard Worker
17*d5c09012SAndroid Build Coastguard Workerpackage google.cloud.automl.v1;
18*d5c09012SAndroid Build Coastguard Worker
19*d5c09012SAndroid Build Coastguard Workerimport "google/cloud/automl/v1/geometry.proto";
20*d5c09012SAndroid Build Coastguard Worker
21*d5c09012SAndroid Build Coastguard Workeroption csharp_namespace = "Google.Cloud.AutoML.V1";
22*d5c09012SAndroid Build Coastguard Workeroption go_package = "cloud.google.com/go/automl/apiv1/automlpb;automlpb";
23*d5c09012SAndroid Build Coastguard Workeroption java_multiple_files = true;
24*d5c09012SAndroid Build Coastguard Workeroption java_package = "com.google.cloud.automl.v1";
25*d5c09012SAndroid Build Coastguard Workeroption php_namespace = "Google\\Cloud\\AutoMl\\V1";
26*d5c09012SAndroid Build Coastguard Workeroption ruby_package = "Google::Cloud::AutoML::V1";
27*d5c09012SAndroid Build Coastguard Worker
28*d5c09012SAndroid Build Coastguard Worker// Annotation details for image object detection.
29*d5c09012SAndroid Build Coastguard Workermessage ImageObjectDetectionAnnotation {
30*d5c09012SAndroid Build Coastguard Worker  // Output only. The rectangle representing the object location.
31*d5c09012SAndroid Build Coastguard Worker  BoundingPoly bounding_box = 1;
32*d5c09012SAndroid Build Coastguard Worker
33*d5c09012SAndroid Build Coastguard Worker  // Output only. The confidence that this annotation is positive for the parent example,
34*d5c09012SAndroid Build Coastguard Worker  // value in [0, 1], higher means higher positivity confidence.
35*d5c09012SAndroid Build Coastguard Worker  float score = 2;
36*d5c09012SAndroid Build Coastguard Worker}
37*d5c09012SAndroid Build Coastguard Worker
38*d5c09012SAndroid Build Coastguard Worker// Bounding box matching model metrics for a single intersection-over-union
39*d5c09012SAndroid Build Coastguard Worker// threshold and multiple label match confidence thresholds.
40*d5c09012SAndroid Build Coastguard Workermessage BoundingBoxMetricsEntry {
41*d5c09012SAndroid Build Coastguard Worker  // Metrics for a single confidence threshold.
42*d5c09012SAndroid Build Coastguard Worker  message ConfidenceMetricsEntry {
43*d5c09012SAndroid Build Coastguard Worker    // Output only. The confidence threshold value used to compute the metrics.
44*d5c09012SAndroid Build Coastguard Worker    float confidence_threshold = 1;
45*d5c09012SAndroid Build Coastguard Worker
46*d5c09012SAndroid Build Coastguard Worker    // Output only. Recall under the given confidence threshold.
47*d5c09012SAndroid Build Coastguard Worker    float recall = 2;
48*d5c09012SAndroid Build Coastguard Worker
49*d5c09012SAndroid Build Coastguard Worker    // Output only. Precision under the given confidence threshold.
50*d5c09012SAndroid Build Coastguard Worker    float precision = 3;
51*d5c09012SAndroid Build Coastguard Worker
52*d5c09012SAndroid Build Coastguard Worker    // Output only. The harmonic mean of recall and precision.
53*d5c09012SAndroid Build Coastguard Worker    float f1_score = 4;
54*d5c09012SAndroid Build Coastguard Worker  }
55*d5c09012SAndroid Build Coastguard Worker
56*d5c09012SAndroid Build Coastguard Worker  // Output only. The intersection-over-union threshold value used to compute
57*d5c09012SAndroid Build Coastguard Worker  // this metrics entry.
58*d5c09012SAndroid Build Coastguard Worker  float iou_threshold = 1;
59*d5c09012SAndroid Build Coastguard Worker
60*d5c09012SAndroid Build Coastguard Worker  // Output only. The mean average precision, most often close to au_prc.
61*d5c09012SAndroid Build Coastguard Worker  float mean_average_precision = 2;
62*d5c09012SAndroid Build Coastguard Worker
63*d5c09012SAndroid Build Coastguard Worker  // Output only. Metrics for each label-match confidence_threshold from
64*d5c09012SAndroid Build Coastguard Worker  // 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99. Precision-recall curve is
65*d5c09012SAndroid Build Coastguard Worker  // derived from them.
66*d5c09012SAndroid Build Coastguard Worker  repeated ConfidenceMetricsEntry confidence_metrics_entries = 3;
67*d5c09012SAndroid Build Coastguard Worker}
68*d5c09012SAndroid Build Coastguard Worker
69*d5c09012SAndroid Build Coastguard Worker// Model evaluation metrics for image object detection problems.
70*d5c09012SAndroid Build Coastguard Worker// Evaluates prediction quality of labeled bounding boxes.
71*d5c09012SAndroid Build Coastguard Workermessage ImageObjectDetectionEvaluationMetrics {
72*d5c09012SAndroid Build Coastguard Worker  // Output only. The total number of bounding boxes (i.e. summed over all
73*d5c09012SAndroid Build Coastguard Worker  // images) the ground truth used to create this evaluation had.
74*d5c09012SAndroid Build Coastguard Worker  int32 evaluated_bounding_box_count = 1;
75*d5c09012SAndroid Build Coastguard Worker
76*d5c09012SAndroid Build Coastguard Worker  // Output only. The bounding boxes match metrics for each
77*d5c09012SAndroid Build Coastguard Worker  // Intersection-over-union threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
78*d5c09012SAndroid Build Coastguard Worker  // and each label confidence threshold 0.05,0.10,...,0.95,0.96,0.97,0.98,0.99
79*d5c09012SAndroid Build Coastguard Worker  // pair.
80*d5c09012SAndroid Build Coastguard Worker  repeated BoundingBoxMetricsEntry bounding_box_metrics_entries = 2;
81*d5c09012SAndroid Build Coastguard Worker
82*d5c09012SAndroid Build Coastguard Worker  // Output only. The single metric for bounding boxes evaluation:
83*d5c09012SAndroid Build Coastguard Worker  // the mean_average_precision averaged over all bounding_box_metrics_entries.
84*d5c09012SAndroid Build Coastguard Worker  float bounding_box_mean_average_precision = 3;
85*d5c09012SAndroid Build Coastguard Worker}
86