label-studio icon indicating copy to clipboard operation
label-studio copied to clipboard

Export Keypoints in COCO format

Open tlpss opened this issue 3 years ago • 2 comments

Describe the solution you'd like It would be very useful if we could export keypoint annotations using the COCO keypoints format. At the moment, only segmentation and detection of COCO are supported afaik.

The additional "visibility" flag could be configured during setup of the project:

  1. define the keypoint set(s)
  2. define visibility behavior: E.g. consider missing entries as not-labeled (flag=0) and add a tick box to indicate that labeled instances are invisible (flag=1) with default flag=2 for each labeled keypoint.

tlpss avatar Aug 22 '22 07:08 tlpss

@tlpss could you please show examples about visibility flag?

makseq avatar Aug 26 '22 23:08 makseq

@makseq in COCO, keypoints have, next to their u,v coordinates, an additional visibility flag that can have 3 values:

  • 2: keypoint visible (the default I would say)
  • 1: keypoint is labeled but occluded in the image
  • 0: keypoint is not in the image, e.g. the human arm is not in the field of view. In this case x,y should be 0.0.

If you would want to export keypoints to the COCO format we need:

  1. a way to define the object categories and their respective keypoints in the labeling configuration.
  2. for every instance (defined by a bounding box or segmentation mask), a way to label all the keypoints belonging to that category including their visibility flag using an attribute for each keypoint (possibly through the meta information)

This way one can easily add the keypoints field to each annotation in the coco export.

Does this answer your question?

tlpss avatar Aug 29 '22 19:08 tlpss

@tlpss https://github.com/heartexlabs/label-studio-converter/pull/197 - could you switch to this branch of converter and check how keypoint coco export works there?

Just install that converter version from the PR and try to export KeypointsLabels to COCO format.

makseq avatar Feb 08 '23 02:02 makseq

does it work?

RiccardoMaistri avatar Oct 16 '23 13:10 RiccardoMaistri