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 6c03677
Show file tree
Hide file tree
Showing 2 changed files with 677 additions and 16 deletions.
88 changes: 87 additions & 1 deletion 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 @@ -229,7 +238,69 @@ message ClassificationAnnotation{
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])
uint32 class_id = 1;

// 3D point.
KeyPoint3D 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.
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])
uint32 class_id = 1;

// 3D line.
repeated KeyPoint3D 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.
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])
uint32 class_id = 1;

// 3D polygon.
// Points should be put into this field with counter-clockwise order.
repeated PolygonPoint3D 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.
map<string, string> attributes = 3;
}


// List of BoundingBox2DAnnotation
message BoundingBox2DAnnotations {
repeated BoundingBox2DAnnotation annotations = 1;
}
Expand Down Expand Up @@ -258,3 +329,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 6c03677

Please sign in to comment.