Repository navigation
Keep the crowd flag of COCO and YouTube-VIS instance segmentations - #93
Closed
lorinczszabolcs wants to merge 1 commit into
Closed
lorinczszabolcs wants to merge 1 commit into
lorinczszabolcs wants to merge 1 commit into
Conversation
|
/review |
|
Thank you @lorinczszabolcs! We have discussed your approach internally. We'd like to not modify the label base class with some format specific details such as the crowded flag from coco. Happy to discuss alternatives |
Contributor
Author
|
Thanks @JonasWurst, makes sense. As an alternative I would keep the crowd flag inside the COCO and YouTube-VIS format code, for example in format-specific subclasses, so the base classes stay unchanged and both formats still keep crowds on a round trip. Would that work for you? |
|
@lorinczszabolcs at a high level your proposal sounds good. Will you open a new PR? |
Contributor
Author
|
@JonasWurst Opened #94 with the format-specific subclasses. Closing this one in favor of it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What has changed and why?
Proposed fix for lightly-ai/lightly-studio#2959. I am open to other approaches, see the open questions below.
iscrowdfrom the mask encoding, so every RLE mask is written as a crowd. Tools that store single objects as RLE, like LightlyStudio or maskpair withsegmentation_type="rle", export files in which COCO evaluation ignores every object.iscrowd. An RLE mask withiscrowd: 0fails withValueError: could not convert string to float.is_crowd: bool = FalsetoSingleInstanceSegmentationandSingleInstanceSegmentationTrack. COCO and YouTube-VIS input read it fromiscrowd, and the output writes it back as0or1.Open questions
get_coco_segmentationno longer returns the crowd flag, because that value came from the encoding. The function is not exported inlabelformat/__init__.pyor in the docs, and I found no caller in the lightly-ai repositories. If you prefer to keep the signature, I can keep the third value and not use it.iscrowd: 0, because each mask is one object. Before, it wrotetrue.confidenceto the same dataclass and changes the same lines incoco.py. The PR that merges second needs a small rebase.How has it been tested?
iscrowd0 and 1, a COCO round trip that keepsiscrowdfor both encodings, and a YouTube-VIS round trip with an RLE track that is not a crowd and a polygon track that is a crowd. These tests fail on main for the bug cases.is_crowd, and the maskpair RLE test expectsiscrowd: 0.make all-checkson Python 3.8 and 3.14: 184 passed, 1 skipped.iscrowd: 0, and pycocotools gives AP 1.0 instead of -1.0."iscrowd": true, as labelformat 0.1.17 writes them, still read as crowds.