Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

fix: Only export bboxes and polygon segmentations to YOLO #196

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions label_studio_converter/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -900,6 +900,10 @@ def _get_labels(self):
category_name_to_id = dict()

for name, info in self._schema.items():
# ignore labels that are not bounding boxes or segmentations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for a long review.

  1. We have to add rectangle and polygon too - https://labelstud.io/tags/rectangle.html
  2. _get_labels is used in COCO also, COCO supports another set of labels.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that there should be a different _get_labels procedure for YOLO and for COCO, right? Because they support different kinds of labels.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would pass all supported types this way

_get_labels(types=['rectanglelabels', ...])

and used different calls in YOLO and COCO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more question - if _get_labels returns nothing, will the image be included to export?

if (info['type'].lower() != 'rectanglelabels' and
info['type'].lower() != 'polygonlabels'):
continue
labels |= set(info['labels'])
attrs = info['labels_attrs']
for label in attrs:
Expand Down