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

Overlapping masks #2

Closed
elepherai opened this issue Sep 25, 2019 · 13 comments
Closed

Overlapping masks #2

elepherai opened this issue Sep 25, 2019 · 13 comments

Comments

@elepherai
Copy link

Hi, thanks for your great work.

Recently I have been trying to train my own dataset with rotated_maskrcnn.

I found that there are some overlapping masks in the results. The scores are high enough, so I cannot filter them by threshold.

Do you have any suggestions about the overlapping problem? Thank you.

@mrlooi
Copy link
Owner

mrlooi commented Sep 25, 2019

Option 1) Lower NMS threshold
Try reducing the NMS thresh score in the config (yaml file). It's 0.5 by default, 0.3 would be a pretty good threshold.
See MODEL.ROI_HEADS.NMS in config/defaults.py

However, it's possible to still have overlapping masks, especially when 2 rotated boxes have low box overlap, but high mask overlap. This can also happen with regular bounding box detections, but it's a lot less common.
Option 2) Filter by Mask IoU
Compare the mask IoU between 2 detections. If IoU > 0.8 (or some high threshold), discard the detection with the lower score

@elepherai
Copy link
Author

Thanks mrlooi, I have used option 2 and it worked fine. As for option 1, should I retrain the model? Or just need to change the NMS threshold in inference?

@mrlooi
Copy link
Owner

mrlooi commented Sep 25, 2019

Just change the NMS threshold. The MODEL.ROI_HEADS.NMS is used during inference.

In the config .yaml, add 'NMS' under 'ROI_HEADS'
Screenshot from 2019-09-25 10-37-50

@elepherai
Copy link
Author

It seems better after changing NMS to 0.3, but still have some overlaps. I decide to combine two methods to reduce overlaps.

Thanks mrlooi.
Have a great day!

@Baby47
Copy link

Baby47 commented Oct 9, 2019

Since you have successfully run this project, i wonder if the rotated results are normal in your dataset, i have trained a model but found the predicted angle is too small so that the predicted bounding boxes are almost horizontal. I wonder your help. @elepherai @mrlooi

Thanks very much!

@mrlooi
Copy link
Owner

mrlooi commented Oct 9, 2019

Do you have example images of the predictions?
It's possible that horizontal bounding boxes could be the best fit for the object too

@Baby47
Copy link

Baby47 commented Oct 9, 2019

I have. Sorry, i cannot make full sense of your idea. Would you like to leave your contact information? @mrlooi

@elepherai
Copy link
Author

@Baby47 Hi, the roteated results are normal, and the angles also make sense in my dataset.

@mrlooi
Copy link
Owner

mrlooi commented Oct 9, 2019

@Baby47 can you post an example of the predicted results?

@Baby47
Copy link

Baby47 commented Oct 9, 2019

It’s not convenient to post here . The angle is about 1 or 2 really small number. @mrlooi

@mrlooi
Copy link
Owner

mrlooi commented Oct 9, 2019

What I meant was you can post a picture of the predictions generated using the infer_demo.py file

@Baby47
Copy link

Baby47 commented Oct 9, 2019

Can you leave your email address? @elepherial

@elepherai
Copy link
Author

@Baby47 elepher.ai AT gmail.com

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

No branches or pull requests

3 participants