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

Generate ground_truth instance mask using polygons #255

Closed
txytju opened this issue Dec 8, 2018 · 2 comments
Closed

Generate ground_truth instance mask using polygons #255

txytju opened this issue Dec 8, 2018 · 2 comments
Labels
question Further information is requested

Comments

@txytju
Copy link

txytju commented Dec 8, 2018

❓ Questions and Help

When I tried to train mask-rcnn on my own dataset, I found that a well-trained model can't predict good mask on images(in the training set) in which instance polygons are complex(which may have more than 5 polygons). So I'm kind of worried that the complex instance binary masks were not generated correctly. Will anyone tells me that where in the project can I find code that generates binary mask using instance polygons so I can generate ground_truth masks to make sure they are what I exactly want. Thanks in advance!

@fmassa
Copy link
Contributor

fmassa commented Dec 10, 2018

Hi,

In order to convert a polygon mask into a binary mask, you can use the .convert method from the Polygon object.
Here is an example of how you can create an instance of the SegmentationMask (which is a list of polygons).

I'm closing this issue as I've replied to your question, but let me know if you have further questions.

@fmassa fmassa closed this as completed Dec 10, 2018
@fmassa fmassa added the question Further information is requested label Dec 10, 2018
@txytju
Copy link
Author

txytju commented Dec 11, 2018

Thanks! I use these blocks to plot instance masks and verified that holes in instances are labeled as foreground, which means that binary mask is necessary in my task, as expected in Issue 256

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

No branches or pull requests

2 participants