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

[Fix]: fix mask AP of small/medium/large #4898

Merged
merged 6 commits into from
Apr 30, 2021

Conversation

ZwwWayne
Copy link
Collaborator

@ZwwWayne ZwwWayne commented Apr 5, 2021

This PR delete the key bbox in the prediction results when calculating the mask AP of predictions.
When calculating segm AP, if key bbox is in the prediction, the area of instance will be calculated by the box area rather than the mask area, which will not affect the overall mask AP but will lead to a different mask APs of small/medium/large instances. A comparison is as below

model modification mask AP AP50 AP75 APs APm APl
Mask R-CNN ms3x (ckpt) before 0.370 0.584 0.393 0.205 0.402 0.497
after 0.370 0.584 0.393 0.182 0.395 0.520
Cascade Mask R-CNN 1x (ckpt) before 0.360 0.564 0.387 0.185 0.387 0.494
after 0.360 0.564 0.387 0.163 0.382 0.529

@codecov
Copy link

codecov bot commented Apr 5, 2021

Codecov Report

Merging #4898 (6b3a7cd) into master (ca95937) will decrease coverage by 0.73%.
The diff coverage is 37.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4898      +/-   ##
==========================================
- Coverage   65.61%   64.87%   -0.74%     
==========================================
  Files         255      267      +12     
  Lines       19990    20649     +659     
  Branches     3396     3478      +82     
==========================================
+ Hits        13117    13397     +280     
- Misses       6171     6496     +325     
- Partials      702      756      +54     
Flag Coverage Δ
unittests 64.85% <37.50%> (-0.73%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmdet/datasets/coco.py 45.84% <30.00%> (-0.47%) ⬇️
...mdet/core/bbox/iou_calculators/iou2d_calculator.py 82.50% <40.90%> (-14.28%) ⬇️
mmdet/models/utils/transformer.py 44.91% <0.00%> (-31.53%) ⬇️
mmdet/models/dense_heads/retina_sepbn_head.py 60.71% <0.00%> (-13.36%) ⬇️
mmdet/models/necks/rfp.py 53.22% <0.00%> (-12.93%) ⬇️
mmdet/models/dense_heads/yolo_head.py 50.92% <0.00%> (-11.03%) ⬇️
mmdet/models/dense_heads/centripetal_head.py 47.82% <0.00%> (-10.42%) ⬇️
mmdet/models/roi_heads/bbox_heads/bbox_head.py 77.94% <0.00%> (-9.99%) ⬇️
mmdet/models/dense_heads/ga_retina_head.py 62.22% <0.00%> (-8.69%) ⬇️
mmdet/models/detectors/rpn.py 58.62% <0.00%> (-8.63%) ⬇️
... and 134 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcf8fc3...6b3a7cd. Read the comment docs.

@ZwwWayne ZwwWayne requested a review from jshilong April 6, 2021 08:52
mmdet/datasets/coco.py Outdated Show resolved Hide resolved
docs/compatibility.md Outdated Show resolved Hide resolved
@Johnson-Wang
Copy link
Collaborator

This is indeed a breaking change. I think we'd better design a better way to inform the users about the change.

ZwwWayne and others added 2 commits April 13, 2021 13:01
@ZwwWayne
Copy link
Collaborator Author

This is indeed a breaking change. I think we'd better design a better way to inform the users about the change.

Any suggestion? For now, I plan to inform to do that through the compatibility documentation and the changelog.

@Johnson-Wang
Copy link
Collaborator

How about adding a reminder in the logger?

@ZwwWayne
Copy link
Collaborator Author

How about adding a reminder in the logger?

Agree, will do that.

@ZwwWayne ZwwWayne requested a review from xvjiarui April 30, 2021 06:31
Copy link
Collaborator

@jshilong jshilong left a comment

Choose a reason for hiding this comment

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

LGTM

@ZwwWayne ZwwWayne merged commit 454aa80 into open-mmlab:master Apr 30, 2021
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.

None yet

4 participants