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

auto_augment: img_shape broken #6259

Merged
merged 6 commits into from
Oct 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mmdet/datasets/pipelines/auto_augment.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ def _shear_img(self,
border_value=self.img_fill_val,
interpolation=interpolation)
results[key] = img_sheared.astype(img.dtype)
results['img_shape'] = results[key].shape

def _shear_bboxes(self, results, magnitude):
"""Shear the bboxes."""
Expand Down Expand Up @@ -421,6 +422,7 @@ def _rotate_img(self, results, angle, center=None, scale=1.0):
img_rotated = mmcv.imrotate(
img, angle, center, scale, border_value=self.img_fill_val)
results[key] = img_rotated.astype(img.dtype)
results['img_shape'] = results[key].shape

def _rotate_bboxes(self, results, rotate_matrix):
"""Rotate the bboxes."""
Expand Down Expand Up @@ -621,6 +623,7 @@ def _translate_img(self, results, offset, direction='horizontal'):
img = results[key].copy()
results[key] = mmcv.imtranslate(
img, offset, direction, self.img_fill_val).astype(img.dtype)
results['img_shape'] = results[key].shape

def _translate_bboxes(self, results, offset):
"""Shift bboxes horizontally or vertically, according to offset."""
Expand Down