HumanSignal / HumanSignal/label-studio-sdk

import multiple segmentations from coco format json

Open
#246 4 comments 0 reactions 0 assignees View on GitHub
Community community:contribution community:issue community:reviewed
Dominant language
Python
Stars
192
Forks
127
Avg merge
1d 18h
Merged PRs (30d)
1

Description

# Problem

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

https://github.com/HumanSignal/label-studio-sdk/blob/5fceb54cc74766f5666db8a835c8301e3d5b4c32/src/label_studio_sdk/converter/imports/coco.py#L54

## for example
### expected

### actual

# Suggestion

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

## from
https://github.com/HumanSignal/label-studio-sdk/blob/5fceb54cc74766f5666db8a835c8301e3d5b4c32/src/label_studio_sdk/converter/imports/coco.py#L218-L227

## 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)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.