Skip to content

Commit

Permalink
schema: add KeyPoint3D, KeyLine3D, Polygon3D
Browse files Browse the repository at this point in the history
- 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]>
  • Loading branch information
2 people authored and nehalmamgain committed Aug 1, 2022
1 parent db695a2 commit 92ca39f
Show file tree
Hide file tree
Showing 2 changed files with 701 additions and 33 deletions.
129 changes: 111 additions & 18 deletions dgp/proto/annotations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ enum AnnotationType {
// Classification.
// (i.e. imagenet classification label)
CLASSIFICATION = 15; // classification

// 3D Key Point in sensor space
KEY_POINT_3D = 16; // key_point_3d

// 3D Key Line in sensor space
KEY_LINE_3D = 17; // key_line_3d

// 3D Polygon in sensor space
POLYGON_3D = 18; // polygon_3d
}

// 2D bounding box
Expand Down Expand Up @@ -105,8 +114,7 @@ message BoundingBox2DAnnotation {
// Instance identifier
uint32 instance_id = 5;

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

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

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

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

// Number of LIDAR points in the Bounding Box
Expand All @@ -166,14 +174,14 @@ message KeyPoint2D {

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

// 2D point.
KeyPoint2D point = 2;

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

// An identifier key. Used to link with other annotations.
Expand All @@ -182,14 +190,16 @@ message KeyPoint2DAnnotation {

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

// 2D line.
repeated KeyPoint2D vertices = 2;

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

// An identifier key. Used to link with other annotations.
Expand All @@ -207,29 +217,97 @@ message PolygonPoint2D {

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

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

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

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

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

// List of BoundingBox2DAnnotation.
// 3D point.
message KeyPoint3D {
// (x, y, z) point (in 3D Cartesian coordinates).
float x = 1;
float y = 2;
float z = 3;
}

// 3D point annotation.
message KeyPoint3DAnnotation {
// Class identifier (should be in [0, num_classes - 1]),
// where num_classes is the total number of classes in your ontology.
uint32 class_id = 1;

// 3D point.
KeyPoint3D point = 2;

// A map of attribute names to their values.
// Add only key/value pairs that are stored in a project document accessible to
// project contributors.
map<string, string> attributes = 3;

// An identifier key. Used to link with other annotations.
string key = 4;
}

// 3D line annotation.
message KeyLine3DAnnotation{
// Class identifier (should be in [0, num_classes - 1]),
// where num_classes is the total number of classes in your ontology.
uint32 class_id = 1;

// 3D line.
repeated KeyPoint3D vertices = 2;

// A map of attribute names to their values.
// Add only key/value pairs that are stored in a project document accessible to
// project contributors.
map<string, string> attributes = 3;

// An identifier key. Used to link with other annotations.
string key = 4;
}

message PolygonPoint3D {
// (x, y, z) point (in 3D Cartesian coordinates).
float x = 1;
float y = 2;
float z = 3;
}

// 3D polygon annotation.
message Polygon3DAnnotation{
// Class identifier (should be in [0, num_classes - 1]),
// where num_classes is the total number of classes in your ontology.
uint32 class_id = 1;

// 3D polygon.
// Points should be put into this field with counter-clockwise order.
repeated PolygonPoint3D vertices = 2;

// A map of attribute names to their values.
// Add only key/value pairs that are stored in a project document accessible to
// project contributors.
map<string, string> attributes = 3;
}


// List of BoundingBox2DAnnotation
message BoundingBox2DAnnotations {
repeated BoundingBox2DAnnotation annotations = 1;
}
Expand Down Expand Up @@ -258,3 +336,18 @@ message Polygon2DAnnotations {
message ClassificationAnnotations {
repeated ClassificationAnnotation annotations = 1;
}

// List of KeyPoint3DAnnotation.
message KeyPoint3DAnnotations {
repeated KeyPoint3DAnnotation annotations = 1;
}

// List of KeyLine3DAnnotation.
message KeyLine3DAnnotations {
repeated KeyLine3DAnnotation annotations = 1;
}

// List of Polygon3DAnnotation.
message Polygon3DAnnotations {
repeated Polygon3DAnnotation annotations = 1;
}
Loading

0 comments on commit 92ca39f

Please sign in to comment.