Skip to content

Commit 2fedac9

Browse files
Nehal Mamgainpd-nisse
authored andcommitted
schema: add KeyPoint3D, KeyLine3D, Polygon3D
- add 3D equivalents in Cartesian coordinates in sensor space for KeyPoint2D, KeyLine2D and Polygon2D on the image plane respectively. Co-authored-by: Nisse Knudsen <[email protected]>
1 parent fec4926 commit 2fedac9

File tree

2 files changed

+707
-35
lines changed

2 files changed

+707
-35
lines changed

dgp/proto/annotations.proto

Lines changed: 117 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ enum AnnotationType {
7070
// Classification.
7171
// (i.e. imagenet classification label)
7272
CLASSIFICATION = 15; // classification
73+
74+
// 3D Key Point in sensor space
75+
KEY_POINT_3D = 16; // key_point_3d
76+
77+
// 3D Key Line in sensor space
78+
KEY_LINE_3D = 17; // key_line_3d
79+
80+
// 3D Polygon in sensor space
81+
POLYGON_3D = 18; // polygon_3d
7382
}
7483

7584
// 2D bounding box
@@ -105,8 +114,7 @@ message BoundingBox2DAnnotation {
105114
// Instance identifier
106115
uint32 instance_id = 5;
107116

108-
// An associative map stores arbitrary attributes, where the key is attribute name
109-
// and the value is attribute value. Both key_type and value_type are string.
117+
// A map of attribute names to their values.
110118
// This can be used to stored `agent_behavior` states (i.e., parked car, pedestrian intent).
111119
map<string, string> attributes = 6;
112120
}
@@ -138,7 +146,8 @@ message BoundingBox3D {
138146

139147
// 3D bounding box annotation.
140148
message BoundingBox3DAnnotation {
141-
// Class identifier. Should be in range [0, num_classes - 1].
149+
// Class identifier. Should be in range [0, num_classes - 1],
150+
// where num_classes is the total number of classes in your ontology.
142151
uint32 class_id = 1;
143152

144153
// 3D box.
@@ -148,8 +157,7 @@ message BoundingBox3DAnnotation {
148157
// This needs to be unique to a scene.
149158
uint32 instance_id = 3;
150159

151-
// An associative map stores arbitrary attributes, where the key is attribute name
152-
// and the value is attribute value. Both key_type and value_type are string.
160+
// A map of attribute names to their values.
153161
map<string, string> attributes = 4;
154162

155163
// Number of LIDAR points in the Bounding Box
@@ -166,33 +174,37 @@ message KeyPoint2D {
166174

167175
// 2D point annotation.
168176
message KeyPoint2DAnnotation {
169-
// Class identifier (should be in [0, num_classes - 1])
177+
// Class identifier (should be in [0, num_classes - 1]),
178+
// where num_classes is the total number of classes in your ontology.
170179
uint32 class_id = 1;
171180

172181
// 2D point.
173182
KeyPoint2D point = 2;
174183

175-
// An associative map stores arbitrary attributes, where the key is attribute name
176-
// and the value is attribute value. Both key_type and value_type are string.
184+
// A map of attribute names to their values.
177185
map<string, string> attributes = 3;
178186

179-
// An identifier key. Used to link with other annotations.
187+
// An identifier key. Used to link with other annotations (example: BoundingBox2D)
188+
// which specify this key in their instance to link to corresponding KeyPoint2DAnnotation.
180189
string key = 4;
181190
}
182191

183192
// 2D line annotation.
184193
message KeyLine2DAnnotation{
185-
// Class identifier (should be in [0, num_classes - 1])
194+
// Class identifier (should be in [0, num_classes - 1]),
195+
// where num_classes is the total number of classes in your ontology.
186196
uint32 class_id = 1;
187197

188198
// 2D line.
189199
repeated KeyPoint2D vertices = 2;
190200

191-
// An associative map stores arbitrary attributes, where the key is attribute name
192-
// and the value is attribute value. Both key_type and value_type are string.
201+
// A map of attribute names to their values.
202+
// Add only key/value pairs that are stored in a project document accessible to
203+
// project contributors.
193204
map<string, string> attributes = 3;
194205

195-
// An identifier key. Used to link with other annotations.
206+
// An identifier key. Used to link with other annotations, which specify this key
207+
// in their instance to link to corresponding KeyLine2DAnnotation.
196208
string key = 4;
197209
}
198210

@@ -207,29 +219,99 @@ message PolygonPoint2D {
207219

208220
// 2D polygon annotation.
209221
message Polygon2DAnnotation{
210-
// Class identifier (should be in [0, num_classes - 1])
222+
// Class identifier (should be in [0, num_classes - 1]),
223+
// where num_classes is the total number of classes in your ontology.
211224
uint32 class_id = 1;
212225

213226
// 2D polygon.
214227
// Points should be put into this field with counter-clockwise order.
215228
repeated PolygonPoint2D vertices = 2;
216229

217-
// An associative map stores arbitrary attributes, where the key is attribute name
218-
// and the value is attribute value. Both key_type and value_type are string.
230+
// A map of attribute names to their values.
219231
map<string, string> attributes = 3;
220232
}
221233

222234
// Classification annotation.
223235
message ClassificationAnnotation{
224-
// Class identifier (should be in [0, num_classes - 1])
236+
// Class identifier (should be in [0, num_classes - 1]),
237+
// where num_classes is the total number of classes in your ontology.
225238
uint32 class_id = 1;
226239

227-
// An associative map stores arbitrary attributes, where the key is attribute name
228-
// and the value is attribute value. Both key_type and value_type are string.
240+
// A map of attribute names to their values.
229241
map<string, string> attributes = 2;
230242
}
231243

232-
// List of BoundingBox2DAnnotation.
244+
// 3D point.
245+
message KeyPoint3D {
246+
// (x, y, z) point (in 3D Cartesian coordinates).
247+
float x = 1;
248+
float y = 2;
249+
float z = 3;
250+
}
251+
252+
// 3D point annotation.
253+
message KeyPoint3DAnnotation {
254+
// Class identifier (should be in [0, num_classes - 1]),
255+
// where num_classes is the total number of classes in your ontology.
256+
uint32 class_id = 1;
257+
258+
// 3D point.
259+
KeyPoint3D point = 2;
260+
261+
// A map of attribute names to their values.
262+
// Add only key/value pairs that are stored in a project document accessible to
263+
// project contributors.
264+
map<string, string> attributes = 3;
265+
266+
// An identifier key. Used to link with other annotations, which specify this key
267+
// in their instance to link to corresponding KeyPoint3DAnnotation.
268+
string key = 4;
269+
}
270+
271+
// 3D line annotation.
272+
message KeyLine3DAnnotation{
273+
// Class identifier (should be in [0, num_classes - 1]),
274+
// where num_classes is the total number of classes in your ontology.
275+
uint32 class_id = 1;
276+
277+
// 3D line.
278+
repeated KeyPoint3D vertices = 2;
279+
280+
// A map of attribute names to their values.
281+
// Add only key/value pairs that are stored in a project document accessible to
282+
// project contributors.
283+
map<string, string> attributes = 3;
284+
285+
// An identifier key. Used to link with other annotations, which specify this key
286+
// in their instance to link to corresponding KeyLine3DAnnotation.
287+
string key = 4;
288+
}
289+
290+
message PolygonPoint3D {
291+
// (x, y, z) point (in 3D Cartesian coordinates).
292+
float x = 1;
293+
float y = 2;
294+
float z = 3;
295+
}
296+
297+
// 3D polygon annotation.
298+
message Polygon3DAnnotation{
299+
// Class identifier (should be in [0, num_classes - 1]),
300+
// where num_classes is the total number of classes in your ontology.
301+
uint32 class_id = 1;
302+
303+
// 3D polygon.
304+
// Points should be put into this field with counter-clockwise order.
305+
repeated PolygonPoint3D vertices = 2;
306+
307+
// A map of attribute names to their values.
308+
// Add only key/value pairs that are stored in a project document accessible to
309+
// project contributors.
310+
map<string, string> attributes = 3;
311+
}
312+
313+
314+
// List of BoundingBox2DAnnotation
233315
message BoundingBox2DAnnotations {
234316
repeated BoundingBox2DAnnotation annotations = 1;
235317
}
@@ -258,3 +340,18 @@ message Polygon2DAnnotations {
258340
message ClassificationAnnotations {
259341
repeated ClassificationAnnotation annotations = 1;
260342
}
343+
344+
// List of KeyPoint3DAnnotation.
345+
message KeyPoint3DAnnotations {
346+
repeated KeyPoint3DAnnotation annotations = 1;
347+
}
348+
349+
// List of KeyLine3DAnnotation.
350+
message KeyLine3DAnnotations {
351+
repeated KeyLine3DAnnotation annotations = 1;
352+
}
353+
354+
// List of Polygon3DAnnotation.
355+
message Polygon3DAnnotations {
356+
repeated Polygon3DAnnotation annotations = 1;
357+
}

0 commit comments

Comments
 (0)