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

Does Icevision support segmentation masks in the RLE bitmask format? #1126

Open
Robotatron opened this issue Jul 28, 2022 · 1 comment
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Robotatron
Copy link

I tried parsers.COCOMaskParser to load my COCO dataset but getting an error:

ValueError: invalid literal for int() with base 10: 'YXi61og0000og00QXO00000O1000000O10O100000O100000000O10000000000O10000000000O01000000000O100000000000000O100000000000000O10001O0000000000000000000O10000000001O000O100000000000001O00000000000O2O0000000

Does that mean icevision only supports polygons for COCO masks?

@Robotatron Robotatron added enhancement New feature or request help wanted Extra attention is needed labels Jul 28, 2022
@gatordevin
Copy link

I just solves this problem myself but it required changing their source files. Essentially your COCO dataset already has encoded RLEs which is what icevision convert all polygons and RLEs to under the covers. They assume that your dataset consists of either polygons or just normal RLE rather than encoded RLEs. I changed the source to remove the second encoding call which is what is calling this issue and it solved my problem. Also ensure you have iscrowd set to 1 rather than set to 0.

def to_erles(self, h, w) -> EncodedRLEs:
return EncodedRLEs(
mask_utils.frPyObjects([{"counts": self.to_coco(), "size": [h, w]}], h, w)
)

Rather than call mask_utils I just took the [{"counts": self.to_coco(), "size": [h, w]}] and passed it into EncodedRLEs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants