label-studio-converter
label-studio-converter copied to clipboard
fix: check for empty segmentation key
This fixes importing a COCO formatted file with an empty segmentation
key, e.g.: {"segmentation":[]}
.
Without this fix, the function create_segmentation
blows up with an IndexError
here:
https://github.com/HumanSignal/label-studio-converter/blob/83ac08ce3870de4bb04834314c017735c5f7bb04/label_studio_converter/imports/coco.py#L54
Had the same issue and can confirm that the changed line in this PR works.
I was converting "VOC to COCO" and this conversion preserved empty segmentation data. I am not really familiar with either data format so I don't know if segmentation is allowed to be empty or should be removed entirely.
We introduced this update in the upcoming label-studio-sdk>=1
. Thanks for noticing this bug! Closing this PR for now, but feel free to submit your further suggestions and feedback in label-studio-sdk repo