xref: /aosp_15_r20/external/googleapis/google/cloud/visionai/v1alpha1/lva.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2022 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.visionai.v1alpha1;
18
19option csharp_namespace = "Google.Cloud.VisionAI.V1Alpha1";
20option go_package = "cloud.google.com/go/visionai/apiv1alpha1/visionaipb;visionaipb";
21option java_multiple_files = true;
22option java_outer_classname = "LvaProto";
23option java_package = "com.google.cloud.visionai.v1alpha1";
24option php_namespace = "Google\\Cloud\\VisionAI\\V1alpha1";
25option ruby_package = "Google::Cloud::VisionAI::V1alpha1";
26
27// Represents an actual value of an operator attribute.
28message AttributeValue {
29  // Attribute value.
30  oneof value {
31    // int.
32    int64 i = 1;
33
34    // float.
35    float f = 2;
36
37    // bool.
38    bool b = 3;
39
40    // string.
41    bytes s = 4;
42  }
43}
44
45// Defines an Analyzer.
46//
47// An analyzer processes data from its input streams using the logic defined in
48// the Operator that it represents. Of course, it produces data for the output
49// streams declared in the Operator.
50message AnalyzerDefinition {
51  // The inputs to this analyzer.
52  //
53  // We accept input name references of the following form:
54  // <analyzer-name>:<output-argument-name>
55  //
56  // Example:
57  //
58  // Suppose you had an operator named "SomeOp" that has 2 output
59  // arguments, the first of which is named "foo" and the second of which is
60  // named "bar", and an operator named "MyOp" that accepts 2 inputs.
61  //
62  // Also suppose that there is an analyzer named "some-analyzer" that is
63  // running "SomeOp" and another analyzer named "my-analyzer" running "MyOp".
64  //
65  // To indicate that "my-analyzer" is to consume "some-analyzer"'s "foo"
66  // output as its first input and "some-analyzer"'s "bar" output as its
67  // second input, you can set this field to the following:
68  // input = ["some-analyzer:foo", "some-analyzer:bar"]
69  message StreamInput {
70    // The name of the stream input (as discussed above).
71    string input = 1;
72  }
73
74  // Options available for debugging purposes only.
75  message DebugOptions {
76    // Environment variables.
77    map<string, string> environment_variables = 1;
78  }
79
80  // The name of this analyzer.
81  //
82  // Tentatively [a-z][a-z0-9]*(_[a-z0-9]+)*.
83  string analyzer = 1;
84
85  // The name of the operator that this analyzer runs.
86  //
87  // Must match the name of a supported operator.
88  string operator = 2;
89
90  // Input streams.
91  repeated StreamInput inputs = 3;
92
93  // The attribute values that this analyzer applies to the operator.
94  //
95  // Supply a mapping between the attribute names and the actual value you wish
96  // to apply. If an attribute name is omitted, then it will take a
97  // preconfigured default value.
98  map<string, AttributeValue> attrs = 4;
99
100  // Debug options.
101  DebugOptions debug_options = 5;
102}
103
104// Defines a full analysis.
105//
106// This is a description of the overall live analytics pipeline.
107// You may think of this as an edge list representation of a multigraph.
108//
109// This may be directly authored by a human in protobuf textformat, or it may be
110// generated by a programming API (perhaps Python or JavaScript depending on
111// context).
112message AnalysisDefinition {
113  // Analyzer definitions.
114  repeated AnalyzerDefinition analyzers = 1;
115}
116