-
Notifications
You must be signed in to change notification settings - Fork 5
/
features.proto
199 lines (179 loc) · 7.76 KB
/
features.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
syntax = "proto3";
// MLModelScope
//
// MLModelScope is a hardware/software agnostic platform
// to facilitate the evaluation, measurement, and introspection
// of ML models within AI pipelines. MLModelScope aids application
// developers in discovering and experimenting with models, data
// scientists developers in replicating and evaluating for publishing
// models, and system architects in understanding the performance of AI
// workloads.
package mlmodelscope.org.dlframework;
import "google/api/annotations.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option (gogoproto.goproto_registration) = true;
option (gogoproto.gostring_all) = true;
option (gogoproto.equal_all) = true;
option (gogoproto.verbose_equal_all) = true;
option (gogoproto.goproto_stringer_all) = false;
option (gogoproto.stringer_all) = true;
option (gogoproto.populate_all) = true;
option (gogoproto.testgen_all) = true;
option (gogoproto.benchgen_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
option (gogoproto.unmarshaler_all) = true;
option go_package = "dlframework";
enum FeatureType {
UNKNOWN = 0;
IMAGE = 1;
RAW_IMAGE = 2;
CLASSIFICATION = 3;
BOUNDINGBOX = 4;
SEMANTICSEGMENT = 5;
INSTANCESEGMENT = 6;
GEOLOCATION = 7;
REGION = 8;
TEXT = 9;
AUDIO = 10;
RAW = 100;
}
// message Pixel {
// option (gogoproto.description) = true;
// int32 index = 1 [ (gogoproto.moretags) = "yaml:\"index,omitempty\"" ];
// string label = 2 [ (gogoproto.moretags) = "yaml:\"label,omitempty\"" ];
// int32 value = 3 [ (gogoproto.moretags) = "yaml:\"value,omitempty\"" ];
// }
message Image {
// An id used to identify the output feature: maps to input_id for output
string id = 1 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id,omitempty",
(gogoproto.moretags) = "yaml:\"id,omitempty\""
];
// The image is base64 encoded
bytes data = 2 [ (gogoproto.moretags) = "yaml:\"data,omitempty\"" ];
// Preprocessed is set to true to disable preprocessing.
// If enabled then the image is assumed to be rescaled and
// encoded as an array of float32 values
// comment out for now
// bool preprocessed = 3
// [ (gogoproto.moretags) = "yaml:\"preprocessed,omitempty\"" ];
}
message RawImage {
// An id used to identify the output feature: maps to input_id for output
string id = 1 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id,omitempty",
(gogoproto.moretags) = "yaml:\"id,omitempty\""
];
string data_type = 2
[ (gogoproto.moretags) = "yaml:\"data_type,omitempty\"" ];
repeated int32 char_list = 3
[ packed = true, (gogoproto.moretags) = "yaml:\"char_list,omitempty\"" ];
repeated float float_list = 4
[ packed = true, (gogoproto.moretags) = "yaml:\"float_list,omitempty\"" ];
int32 width = 5 [ (gogoproto.moretags) = "yaml:\"width,omitempty\"" ];
int32 height = 6 [ (gogoproto.moretags) = "yaml:\"height,omitempty\"" ];
int32 channels = 7 [ (gogoproto.moretags) = "yaml:\"channels,omitempty\"" ];
// compressed data is only used by the webserver and javascript codes
bytes compressed_data = 8
[ (gogoproto.moretags) = "yaml:\"compressed_data,omitempty\"" ];
// jpeg data is only used by the webserver and javascript codes
bytes jpeg_data = 9
[ (gogoproto.moretags) = "yaml:\"jpeg_data,omitempty\"" ];
}
message Classification {
option (gogoproto.description) = true;
int32 index = 1 [ (gogoproto.moretags) = "yaml:\"index,omitempty\"" ];
string label = 2 [ (gogoproto.moretags) = "yaml:\"label,omitempty\"" ];
}
message BoundingBox {
option (gogoproto.description) = true;
int32 index = 1 [ (gogoproto.moretags) = "yaml:\"index,omitempty\"" ];
string label = 2 [ (gogoproto.moretags) = "yaml:\"label,omitempty\"" ];
float xmin = 3 [ (gogoproto.moretags) = "yaml:\"xmin,omitempty\"" ];
float xmax = 4 [ (gogoproto.moretags) = "yaml:\"xmax,omitempty\"" ];
float ymin = 5 [ (gogoproto.moretags) = "yaml:\"ymin,omitempty\"" ];
float ymax = 6 [ (gogoproto.moretags) = "yaml:\"ymax,omitempty\"" ];
}
message SemanticSegment {
option (gogoproto.description) = true;
int32 height = 1 [ (gogoproto.moretags) = "yaml:\"height,omitempty\"" ];
int32 width = 2 [ (gogoproto.moretags) = "yaml:\"width,omitempty\"" ];
repeated int32 int_mask = 3
[ packed = true, (gogoproto.moretags) = "yaml:\"int_mask,omitempty\"" ];
}
message InstanceSegment {
option (gogoproto.description) = true;
int32 index = 1 [ (gogoproto.moretags) = "yaml:\"index,omitempty\"" ];
string label = 2 [ (gogoproto.moretags) = "yaml:\"label,omitempty\"" ];
float xmin = 3 [ (gogoproto.moretags) = "yaml:\"xmin,omitempty\"" ];
float xmax = 4 [ (gogoproto.moretags) = "yaml:\"xmax,omitempty\"" ];
float ymin = 5 [ (gogoproto.moretags) = "yaml:\"ymin,omitempty\"" ];
float ymax = 6 [ (gogoproto.moretags) = "yaml:\"ymax,omitempty\"" ];
string mask_type = 7
[ (gogoproto.moretags) = "yaml:\"mask_type,omitempty\"" ];
int32 height = 8 [ (gogoproto.moretags) = "yaml:\"height,omitempty\"" ];
int32 width = 9 [ (gogoproto.moretags) = "yaml:\"width,omitempty\"" ];
repeated int32 int_mask = 10
[ packed = true, (gogoproto.moretags) = "yaml:\"int_mask,omitempty\"" ];
repeated float float_mask = 11
[ packed = true, (gogoproto.moretags) = "yaml:\"float_mask,omitempty\"" ];
}
message GeoLocation {
option (gogoproto.description) = true;
int32 index = 1 [ (gogoproto.moretags) = "yaml:\"index,omitempty\"" ];
float latitude = 2 [ (gogoproto.moretags) = "yaml:\"latitude,omitempty\"" ];
float longitude = 3 [ (gogoproto.moretags) = "yaml:\"longitude,omitempty\"" ];
}
message Region {
option (gogoproto.description) = true;
bytes data = 1 [ (gogoproto.moretags) = "yaml:\"data,omitempty\"" ];
string format = 2 [ (gogoproto.moretags) = "yaml:\"format,omitempty\"" ];
}
message Text {
option (gogoproto.description) = true;
bytes data = 2 [ (gogoproto.moretags) = "yaml:\"data,omitempty\"" ];
}
message Audio {
option (gogoproto.description) = true;
bytes data = 1 [ (gogoproto.moretags) = "yaml:\"data,omitempty\"" ];
string format = 2 [ (gogoproto.moretags) = "yaml:\"format,omitempty\"" ];
}
message Raw {
option (gogoproto.description) = true;
bytes data = 1 [ (gogoproto.moretags) = "yaml:\"data,omitempty\"" ];
string format = 2 [ (gogoproto.moretags) = "yaml:\"format,omitempty\"" ];
}
message Feature {
option (gogoproto.description) = true;
string id = 1 [
(gogoproto.customname) = "ID",
(gogoproto.jsontag) = "id,omitempty",
(gogoproto.moretags) = "yaml:\"id,omitempty\""
];
FeatureType type = 3 [ (gogoproto.moretags) = "yaml:\"type,omitempty\"" ];
float probability = 4
[ (gogoproto.moretags) = "yaml:\"probability,omitempty\"" ];
map<string, string> metadata = 5
[ (gogoproto.moretags) = "yaml:\"metadata,omitempty\"" ];
oneof feature {
Image image = 6 [ (gogoproto.moretags) = "yaml:\"image,omitempty\"" ];
RawImage raw_image = 7 [ (gogoproto.moretags) = "yaml:\"image,omitempty\"" ];
Classification classification = 8
[ (gogoproto.moretags) = "yaml:\"classification,omitempty\"" ];
BoundingBox bounding_box = 9
[ (gogoproto.moretags) = "yaml:\"boundingbox,omitempty\"" ];
SemanticSegment semantic_segment = 10
[ (gogoproto.moretags) = "yaml:\"semantic_segment,omitempty\"" ];
InstanceSegment instance_segment = 11
[ (gogoproto.moretags) = "yaml:\"instancesegment,omitempty\"" ];
Text text = 12 [ (gogoproto.moretags) = "yaml:\"text,omitempty\"" ];
Region region = 13 [ (gogoproto.moretags) = "yaml:\"region,omitempty\"" ];
Audio audio = 14 [ (gogoproto.moretags) = "yaml:\"audio,omitempty\"" ];
GeoLocation geolocation = 15
[ (gogoproto.moretags) = "yaml:\"geolocation,omitempty\"" ];
Raw raw = 1000 [ (gogoproto.moretags) = "yaml:\"raw,omitempty\"" ];
}
}