Skip to content

Commit 0795b94

Browse files
nehalmamgainpd-nisseNehal Mamgain
authored
schema: add KeyPoint3D, KeyLine3D, Polygon3D (#101)
- 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]> Co-authored-by: Nehal Mamgain <[email protected]>
1 parent e01e18f commit 0795b94

File tree

2 files changed

+712
-37
lines changed

2 files changed

+712
-37
lines changed

dgp/proto/annotations.proto

Lines changed: 122 additions & 22 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,17 +114,18 @@ 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.
110-
// This can be used to stored `agent_behavior` states (i.e., parked car, pedestrian intent).
117+
// A map of attribute names to their values.
118+
// This can be used to stored `agent_behavior` states (i.e., parked car,
119+
// pedestrian intent).
111120
map<string, string> attributes = 6;
112121
}
113122

114123
// 3D bounding box
115124
message BoundingBox3D {
116125
// 3D Bounding box. Produced by first constructing a box of dimensions
117126
// width, length, height centered at the origin, then rotating it by the
118-
// specified quaternion and finally translating the box to the center coordinate.
127+
// specified quaternion and finally translating the box to the center
128+
// coordinate.
119129

120130
// 6DoF pose of bounding 3D.
121131
// (Translation is the center point of the box)
@@ -138,7 +148,8 @@ message BoundingBox3D {
138148

139149
// 3D bounding box annotation.
140150
message BoundingBox3DAnnotation {
141-
// Class identifier. Should be in range [0, num_classes - 1].
151+
// Class identifier. Should be in range [0, num_classes - 1],
152+
// where num_classes is the total number of classes in your ontology.
142153
uint32 class_id = 1;
143154

144155
// 3D box.
@@ -148,8 +159,7 @@ message BoundingBox3DAnnotation {
148159
// This needs to be unique to a scene.
149160
uint32 instance_id = 3;
150161

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.
162+
// A map of attribute names to their values.
153163
map<string, string> attributes = 4;
154164

155165
// Number of LIDAR points in the Bounding Box
@@ -166,33 +176,38 @@ message KeyPoint2D {
166176

167177
// 2D point annotation.
168178
message KeyPoint2DAnnotation {
169-
// Class identifier (should be in [0, num_classes - 1])
179+
// Class identifier (should be in [0, num_classes - 1]),
180+
// where num_classes is the total number of classes in your ontology.
170181
uint32 class_id = 1;
171182

172183
// 2D point.
173184
KeyPoint2D point = 2;
174185

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.
186+
// A map of attribute names to their values.
177187
map<string, string> attributes = 3;
178188

179-
// An identifier key. Used to link with other annotations.
189+
// An identifier key. Used to link with other annotations
190+
// (example: BoundingBox2D) which specify this key in their
191+
// instance to link to corresponding KeyPoint2DAnnotation.
180192
string key = 4;
181193
}
182194

183195
// 2D line annotation.
184196
message KeyLine2DAnnotation{
185-
// Class identifier (should be in [0, num_classes - 1])
197+
// Class identifier (should be in [0, num_classes - 1]),
198+
// where num_classes is the total number of classes in your ontology.
186199
uint32 class_id = 1;
187200

188201
// 2D line.
189202
repeated KeyPoint2D vertices = 2;
190203

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.
204+
// A map of attribute names to their values.
205+
// Add only key/value pairs that are stored in a project document accessible
206+
// to project contributors.
193207
map<string, string> attributes = 3;
194208

195-
// An identifier key. Used to link with other annotations.
209+
// An identifier key. Used to link with other annotations, which specify
210+
// this key in their instance to link to corresponding KeyLine2DAnnotation.
196211
string key = 4;
197212
}
198213

@@ -207,29 +222,99 @@ message PolygonPoint2D {
207222

208223
// 2D polygon annotation.
209224
message Polygon2DAnnotation{
210-
// Class identifier (should be in [0, num_classes - 1])
225+
// Class identifier (should be in [0, num_classes - 1]),
226+
// where num_classes is the total number of classes in your ontology.
211227
uint32 class_id = 1;
212228

213229
// 2D polygon.
214230
// Points should be put into this field with counter-clockwise order.
215231
repeated PolygonPoint2D vertices = 2;
216232

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.
233+
// A map of attribute names to their values.
219234
map<string, string> attributes = 3;
220235
}
221236

222237
// Classification annotation.
223238
message ClassificationAnnotation{
224-
// Class identifier (should be in [0, num_classes - 1])
239+
// Class identifier (should be in [0, num_classes - 1]),
240+
// where num_classes is the total number of classes in your ontology.
225241
uint32 class_id = 1;
226242

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.
243+
// A map of attribute names to their values.
229244
map<string, string> attributes = 2;
230245
}
231246

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

0 commit comments

Comments
 (0)