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

fix: check for empty segmentation key #238

Closed

Conversation

pztrick
Copy link

@pztrick pztrick commented Aug 20, 2023

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:

segmentation = annotation['segmentation'][0]

@pztrick pztrick changed the title bugfix: check for empty segmentation key fix: check for empty segmentation key Aug 21, 2023
@ScrambledRK
Copy link

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.

@niklub
Copy link
Contributor

niklub commented Jun 4, 2024

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

@niklub niklub closed this Jun 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants