-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Support TTA of RetinaNet and GFL #3638
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3638 +/- ##
==========================================
+ Coverage 60.93% 61.04% +0.10%
==========================================
Files 217 218 +1
Lines 15374 15394 +20
Branches 2628 2633 +5
==========================================
+ Hits 9368 9397 +29
+ Misses 5537 5525 -12
- Partials 469 472 +3
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi @xvjiarui, |
Hi @shinya7y |
if with_nms: | ||
# some heads don't support with_nms argument | ||
proposals = self._get_bboxes_single(cls_score_list, | ||
bbox_pred_list, | ||
mlvl_anchors, img_shape, | ||
scale_factor, cfg, rescale) | ||
else: | ||
proposals = self._get_bboxes_single(cls_score_list, | ||
bbox_pred_list, | ||
mlvl_anchors, img_shape, | ||
scale_factor, cfg, rescale, | ||
with_nms) |
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.
If we just pass with_nms
into self._get_bboxes_single
, will any detector raise an error?
I checked all heads inherited AnchorHead
, it looks fine except for ATSSHead
.
We may support it in ATSSHead
.
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.
ATSSHead
will not raise an error, since it has own get_bboxes
.
But RPNHead
will raise an error.
The code above also avoids breaking compatibility with mmdetection forks and other PRs.
Needless to say, the code should be cleaned after the with_nms
argument becomes standard.
Except for the comments, the code looks good to me. |
In the updated codes, more detectors and dense_heads have |
|
||
|
||
@HEADS.register_module() | ||
class AnchorHead(BaseDenseHead): | ||
class AnchorHead(BaseDenseHead, BBoxTestMixin): |
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.
RPNHead has a mixin RPNTestMixin
, can these two mixins somehow be merged to avoid confusion?
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.
Simple merge of dense_test_mixins.py
and rpn_test_mixin.py
causes another confusion, because dense_test_mixins.py
focuses on TTA, and doesn't have simple_test
.
This issue comes from the following inconsistencies.
roi_heads
havesimple_test
RPNHead
andGARPNHead
havesimple_test_rpn
dense_heads
don't havesimple_test
I think the inconsistencies should be addressed by a PR for refactoring, not by this PR for adding a feature.
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.
Agree. A later refactoring will be proposed.
Task linked: CU-4fpu0b Single Stage TTA |
Hi @shinya7y! Thanks for your contribution. I've tested your PR and I found that after commit |
Hi @yeliudev! Could you please provide more information about "the performance of TTA"? |
Thanks for your reply! The 'performance' I mentioned means AP, and I'm using RetinaNet. I notice that the drop of the AP might not be caused by this PR itself. I'm doing more tests. |
This PR partially responds to the demand for TTA of single-stage detectors.
#3633 #2931 (comment) #509
RetinaNet (model)
GFL (model)
Disclaimer: Unless otherwise stated, my past, present, and future Contributions have nothing to do with my employer.