Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Support RLE format and binary masks. #16

Closed
wangg12 opened this issue Oct 25, 2018 · 5 comments
Closed

Support RLE format and binary masks. #16

wangg12 opened this issue Oct 25, 2018 · 5 comments
Labels

Comments

@wangg12
Copy link
Contributor

wangg12 commented Oct 25, 2018

🚀 Feature

Currently the code is based on polygon masks. RLE and binary masks should be supported for general datasets.

@fmassa
Copy link
Contributor

fmassa commented Oct 25, 2018

I totally agree about binary masks. Indeed, there is a draft implementation in here that supports some functionality.

Ideally, I'd want SegmentationMask to internally support both Polygons and Masks, but I didn't do it yet because it was not necessary for the experiments I was performing.

I'm less sure about RLE format, is it commonly used elsewhere, or only in COCO for the crowd category?

But contributions are more than welcome! :-)

@fmassa fmassa added enhancement New feature or request contributions welcome labels Oct 25, 2018
@wangg12
Copy link
Contributor Author

wangg12 commented Oct 25, 2018

@fmassa For RLE format, we can store it in coco-style json file (Or maybe the paths of binary mask can be stored in json file). Then we can load the json file into memory and convert mask of any format to binary mask, and then do some transformations. I want this feature because sometimes polygons are not very convenient.

@fmassa
Copy link
Contributor

fmassa commented Oct 25, 2018

My understanding is that RLE is great for storing data in disk, but many operations are hard to be performed directly on the RLE representation, and passing via a mask representation is generally easier / necessary.

Here is what I propose: adding full support for binary masks (i.e., finishing the Mask class), and if the user has data in RLE format, we can internally (in the constructor of the SegmentationMask class) convert it into Mask representation, or the user can himself convert from RLE to mask inside his __getitem__.

What do you think?

@wangg12
Copy link
Contributor Author

wangg12 commented Oct 25, 2018

@fmassa Agree with you. The internal converting to binary masks is exactly what I want.

@wangg12 wangg12 changed the title Support RLE format masks. Support RLE format and binary masks. Oct 25, 2018
@LU4E LU4E mentioned this issue Nov 1, 2018
@wangg12
Copy link
Contributor Author

wangg12 commented Nov 14, 2018

Solved by PR #150

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants