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

[Feature] Add tool for converting label studio json result to coco format #2385

Merged
merged 5 commits into from
Jun 15, 2023

Conversation

CescMessi
Copy link
Contributor

@CescMessi CescMessi commented May 21, 2023

Motivation

A tool to convert label studio's json annotation results to coco format.

Modification

Add a single python script file.

BC-breaking (Optional)

Use cases (Optional)

python tools/dataset_converters/labelstudio2coco.py config.xml project-1-at-2023-05-13-09-22-91b53efa.json output/result.json

The config.xml is from Labeling Interface in label studio web ui. The content is like that:

<View>
  <KeyPointLabels name="kp-1" toName="img-1">
  	<Label value="person" background="#D4380D"/>
  </KeyPointLabels>
  <PolygonLabels name="polygonlabel" toName="img-1"> 
  	<Label value="person" background="#0DA39E"/>
  </PolygonLabels>
  <RectangleLabels name="label" toName="img-1"> 
  	<Label value="person" background="#DDA0EE"/>
  </RectangleLabels>
  <Image name="img-1" value="$img"/>
</View>

The project-*.json is from Export -> JSON in label studio web ui. The annotation order should be keypoints, rectangle/polygon.

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit tests to ensure correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • CLA has been signed and all committers have signed the CLA in this PR.

@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.03 ⚠️

Comparison is base (65ef573) 82.04% compared to head (de0d7c8) 82.02%.

❗ Current head de0d7c8 differs from pull request most recent head 0be66ca. Consider uploading reports for the commit 0be66ca to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           dev-1.x    #2385      +/-   ##
===========================================
- Coverage    82.04%   82.02%   -0.03%     
===========================================
  Files          233      233              
  Lines        13643    13643              
  Branches      2320     2320              
===========================================
- Hits         11194    11191       -3     
- Misses        1911     1914       +3     
  Partials       538      538              
Flag Coverage Δ
unittests 82.02% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmpose/structures/bbox/transforms.py 68.70% <ø> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vansin
Copy link
Collaborator

vansin commented May 22, 2023

@CescMessi please write a readme in docs/en/dataset_zoo/label_studio.md and docs/zh/dataset_zoo/label_studio.md

@CescMessi
Copy link
Contributor Author

@CescMessi please write a readme in docs/en/dataset_zoo/label_studio.md and docs/zh/dataset_zoo/label_studio.md

They have been done now.

@Tau-J Tau-J merged commit c5e9378 into open-mmlab:dev-1.x Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants