Skip to content

feat: LEAP-1937: Add brush_to_coco format #429

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

Merged
merged 10 commits into from
Apr 21, 2025

Conversation

KMYsqHRK
Copy link
Contributor

Overview
This PR adds support for converting brush annotations (RLE-encoded) to COCO format. This enables using brush segmentation data in machine learning pipelines that require COCO-formatted annotations.
Changes

Added BRUSH_TO_COCO format to the converter module
Created brush_to_coco.py for RLE decoding and contour extraction
Updated converter interface and CLI options

Features

Converts RLE-encoded brush masks to COCO polygons
Handles mixed annotation types (brush, polygon, rectangle)
Preserves label categories and annotation metadata
Compatible with existing converter workflow

@KMYsqHRK KMYsqHRK changed the title Add brush_to_coco format feat: Add brush_to_coco format Mar 12, 2025
@makseq makseq changed the title feat: Add brush_to_coco format feat: LEAP-1937: Add brush_to_coco format Mar 12, 2025
@KMYsqHRK
Copy link
Contributor Author

Added OpenCV dependencies to pyproject.toml
Added pytest (tests/test_brush_to_coco.py)
fix bugs and update stability

Please review it !

@nikitabelonogov
Copy link
Member

Hi @KMYsqHRK !
Thank you for your contribution!

Unfortunately this repository source code is automatically generated via Fern from https://github.com/HumanSignal/label-studio-client-generator/

your changes will be overridden with next regeneration

@nikitabelonogov
Copy link
Member

Oh OK, nevermind. As for @makseq this part of code is not under auto generator.
I've created a mirror PR #432 for testing purposes.

@KMYsqHRK
Copy link
Contributor Author

KMYsqHRK commented Mar 19, 2025 via email

Copy link
Member

@makseq makseq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please update your branch with the latest master branch from the main LS SDK repo? I am trying to run tests for the main LS and they fail; I think it's because your branch is slightly outdated:
https://github.com/HumanSignal/label-studio/actions/runs/13946116271/job/39033643447?pr=7252

@KMYsqHRK
Copy link
Contributor Author

Regarding the PR review, I'm a student part-timer currently writing a paper, so my response might be delayed. I apologize for the inconvenience!

@triklozoid triklozoid merged commit 39eb62e into HumanSignal:master Apr 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants