Skip to content

Commit

Permalink
Add skeleton fields to Keypoints and Keypoints3D annotations (#659)
Browse files Browse the repository at this point in the history
* Document skeleton parameter purely via class doc

Also include Keypoints3D and Polyline3D in top level visualization
table.

* Specify that Keypoints3D and Polyline3D can be visualized in their own 3d space
  • Loading branch information
munkyshi authored Sep 18, 2024
1 parent a7b6c28 commit 4908c64
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions kolena/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
| [`BoundingBox3D`][kolena.annotation.BoundingBox3D] | Limited to `PointCloud` data |
| [`Polygon`][kolena.annotation.Polygon] | Limited to `Image` or `Video` data |
| [`Polyline`][kolena.annotation.Polyline] | Limited to `Image` or `Video` data |
| [`Polyline3D`][kolena.annotation.Polyline3D] | Can be visualized on `PointCloud` data or in standalone 3D space |
| [`Keypoints`][kolena.annotation.Keypoints] | Limited to `Image` or `Video` data |
| [`Keypoints3D`][kolena.annotation.Keypoints3D] | Can be visualized on `PointCloud` data, or in standalone 3D space |
| [`SegmentationMask`][kolena.annotation.SegmentationMask] | Limited to `Image` or `Video` data |
| [`BitmapMask`][kolena.annotation.BitmapMask] | Limited to `Image` or `Video` data |
| [`Label`][kolena.annotation.Label] | Valid for all data |
Expand Down Expand Up @@ -185,7 +187,14 @@ class ScoredLabeledPolygon(Polygon):

@dataclass(frozen=True, config=ValidatorConfig)
class Keypoints(Annotation):
"""Array of any number of keypoints specified in pixel coordinates."""
"""
Array of any number of keypoints specified in pixel coordinates.
Optionally include a `skeleton` field to indicating connections between `points` indices.
`Keypoints(points=[(0,0),(0,1),(1,1)], skeleton=[(0,1),(0,2)])` will represent three points
with a connection between the `(0,0)` and `(0,1)` point, and between the `(0,0)` and `(1,1)` point.
"""

points: List[Tuple[float, float]]
"""The sequence of discrete `(x, y)` pixel coordinates comprising this keypoints annotation."""
Expand All @@ -197,7 +206,14 @@ def _data_type() -> _AnnotationType:

@dataclass(frozen=True, config=ValidatorConfig)
class Keypoints3D(Annotation):
"""Array of any number of keypoints specified in a right-handed coordinate system."""
"""
Array of any number of keypoints specified in a right-handed coordinate system.
Optionally include a `skeleton` field to indicating connections between `points` indices.
`Keypoints(points=[(0,0,0),(1,0,0),(0,1,0),(0,0,1)], skeleton=[(1,2),(0,3)])` will represent four points
with a connection between the `(1,0,0)` and `(0,1,0)` point, and between the `(0,0,0)` and `(0,0,1)` point.
"""

points: List[Tuple[float, float, float]]
"""The sequence of discrete `(x, y, z)` coordinates comprising this keypoints annotation."""
Expand Down

0 comments on commit 4908c64

Please sign in to comment.