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

Updates in train.py rpn layer and predict.py proprocessing #84

Open
wants to merge 55 commits into
base: master
Choose a base branch
from

Conversation

WangLuran
Copy link
Contributor

Changing the nms algorithm in rpn layer by considering inter over area instead of inter over union. It inceases the speed of divergence and mask quality and a little in ap50. The overlapping of crowns of different types is also solved.
Change in proprocessing in predict.py. Instead of just deleting all crowns with a objectness value less than a threshold, a changed nms algorithm is applied - we use inter over area of masks instead of bounding boxes for a better output.

custom rpn head for custom nms which considers intersection over area and overlapping between different speices is avoided
this file includes a custom nms layer - which uses inter over area instead of inter over union as the anchor selection metric. The issue of crowns of different types overlapping each other is also solved. This change inceases the speed and mask quality a bit.
Another function called nms_mask is used in prediction part and is part of the proprocessing where instead of eliminating all crowns with a low threshold, the nms is used and the nms metric is no longer box iou but mask iou. This change increases the output quality a lot.
@PatBall1
Copy link
Owner

Thanks for this contribution @WangLuran !
There seems to be a few conflicts that are preventing me from merging.
Would you also please comment which functions have been edited (and how)?

@WangLuran
Copy link
Contributor Author

OK, got it! I will merge the commits and write the comments

@@ -391,6 +391,61 @@ def build_train_loader(cls, cfg):
),
)

# def build_optimizer(cls, cfg, model):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using adam optimizer instead of SGD. While SGD is updated recently so this function is commented out.

@@ -448,13 +503,11 @@ def test_train(cls, cfg, model, evaluators=None):
return results


Copy link
Contributor Author

@WangLuran WangLuran Jan 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the following pre_processing functions should not be changed, my version is not updated

@@ -1,64 +1,46 @@
"""Generate predictions."""
Copy link
Contributor Author

@WangLuran WangLuran Jan 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the only change in this one is to import defaultpredictor1 from custom_nms which is a defaultpredictor + proprocessing using mask-nms and use it instead od defaultpredictor. The other conflicts are from that my version is not updated and should not be changed

@ma595
Copy link
Collaborator

ma595 commented Dec 2, 2023

This PR has become stale. @PatBall1 is it still relevant?

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

Successfully merging this pull request may close these issues.

3 participants