-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
auto_augment: img_shape broken #6259
Conversation
@yellowdolphin Please fix the lint |
Codecov Report
@@ Coverage Diff @@
## master #6259 +/- ##
==========================================
- Coverage 61.86% 61.83% -0.04%
==========================================
Files 315 315
Lines 25163 25166 +3
Branches 4185 4185
==========================================
- Hits 15568 15562 -6
- Misses 8782 8796 +14
+ Partials 813 808 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@yellowdolphin Thanks for your contribution! Please install pre-commit and run |
@RangiLyu Done, pre-commit passes now. |
* check/correct img.shape * check/correct img.shape * simpler fix for img_shape * failtest Shear, Translate * fix also _shear_img, _translate_img * flake8
Hi @yellowdolphin !First of all, we want to express our gratitude for your significant PR in the MMDet project. Your contribution is highly appreciated, and we are grateful for your efforts in helping improve this open-source project during your personal time. We believe that many developers will benefit from your PR. We would also like to invite you to join our Special Interest Group (SIG) private channel on Discord, where you can share your experiences, ideas, and build connections with like-minded peers. To join the SIG channel, simply message moderator— OpenMMLab on Discord or briefly share your open-source contributions in the #introductions channel and we will assist you. Look forward to seeing you there! Join us :https://discord.gg/raweFPmdzG If you are Chinese or have WeChat,welcome to join our community on WeChat. You can add our assistant :openmmlabwx. Please add "mmsig + Github ID" as a remark when adding friends:) |
Motivation
Rotate, Shear, and Translate classes change the shape of
results['img']
when applied to the image data, but do not updateresults['img_shape']
. This happens in methods_rotate_img()
,_shear_img
, and_translate_img
.In consequence, methods like
_rotate_bboxes
,_rotate_masks
get the wrong image shape fromresults['img_shape']
.The bboxes don't complain but pipeline raises a ValueError: "cannot reshape array of size 196249 into shape (358,358)" when applied to datasets with masks.
Modification
I added a similar line of code as in
transforms.Resize._resize_img
:results['img_shape'] = results[key].shape
where
key
would default toimg
.BC-breaking (Optional)
None (unless inconsistent shapes where somehow intended).
Use cases (Optional)
train MRCNNs with Resize, Shear, Translate from auto_augment.py