-
Notifications
You must be signed in to change notification settings - Fork 41
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
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for this contribution @WangLuran ! |
OK, got it! I will merge the commits and write the comments |
detectree2/models/train.py
Outdated
@@ -391,6 +391,61 @@ def build_train_loader(cls, cfg): | |||
), | |||
) | |||
|
|||
# def build_optimizer(cls, cfg, model): |
There was a problem hiding this comment.
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.
detectree2/models/train.py
Outdated
@@ -448,13 +503,11 @@ def test_train(cls, cfg, model, evaluators=None): | |||
return results | |||
|
|||
|
There was a problem hiding this comment.
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.""" |
There was a problem hiding this comment.
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
This PR has become stale. @PatBall1 is it still relevant? |
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.