-
Notifications
You must be signed in to change notification settings - Fork 84
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
Conversation
Added OpenCV dependencies to pyproject.toml Please review it ! |
Hi @KMYsqHRK ! 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 |
整数である必要があるようなので元々のコードではintで丸めていた部分をroundにしました。
テストの結果はほとんど変わらなかったのですが、とりあえずroundのままにしています。
2025年3月19日(水) 21:30 NAKAYAMA Atsushi ***@***.***>:
… ***@***.**** commented on this pull request.
------------------------------
In src/label_studio_sdk/converter/exports/brush_to_coco.py
<#429 (comment)>
:
> +
+
+def generate_contour_from_polygon(points, original_width, original_height):
+ """Convert polygon annotations to COCO segmentation format
+
+ Args:
+ points: List of [x, y] points in percentage format
+ original_width: Width of the original image
+ original_height: Height of the original image
+
+ Returns:
+ tuple: (segmentation, bbox, area) in COCO format
+ """
+ # Convert from percentage to absolute coordinates
+ modified_points = [
+ [round(x * original_width / 100), round(y * original_height / 100)]
round()で丸めてしまって大丈夫でしょうか?
—
Reply to this email directly, view it on GitHub
<#429 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BGCF5YOG7R5NFPAIZSLLXS32VFPM3AVCNFSM6AAAAABY3J3QHOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDMOJYGIZTINJQHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
There was a problem hiding this 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
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! |
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