Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import multiple segmentations from coco format json #246

Open
Ljung323 opened this issue Jun 17, 2024 · 4 comments
Open

import multiple segmentations from coco format json #246

Ljung323 opened this issue Jun 17, 2024 · 4 comments

Comments

@Ljung323
Copy link

Problem

when converting coco annotation to label studio format, only the first item is used as a segmentation.

segmentation = annotation["segmentation"][0]

for example

expected

actual

Suggestion

can we use all segmentations instead?
or am I misunderstanding something?

from

if "segmentation" in annotation and len(annotation["segmentation"]):
item = create_segmentation(
annotation,
categories,
segmentation_from_name,
image_height,
image_width,
to_name,
)
task[out_type][0]["result"].append(item)

to

something like this

        if "segmentation" in annotation and len(annotation["segmentation"]):
            for single_segmentation in annotation["segmentation"]:
                item = create_segmentation(
                    annotation["category_id"],
                    single_segmentation,
                    categories,
                    segmentation_from_name,
                    image_height,
                    image_width,
                    to_name,
                )
                task[out_type][0]["result"].append(item)
@makseq
Copy link
Member

makseq commented Jun 18, 2024

It seems it's just not implemented. Could you submit a PR with this?

@Ljung323
Copy link
Author

@makseq
thank you very much for the comment.
I opened a PR: #251

@sajarin
Copy link

sajarin commented Jun 19, 2024

Thanks for reporting this and for opening a PR @Ljung323, our team will take a look at get back to you with comments in the PR

@Ljung323
Copy link
Author

thank you for acknowledging the report and the PR, look forward to a feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants