Skip to content

Commit

Permalink
chirality preserving flip
Browse files Browse the repository at this point in the history
  • Loading branch information
calcoloergosum committed Sep 2, 2024
1 parent 6771c71 commit b1ea012
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mmrotate/datasets/pipelines/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def bbox_flip(self, bboxes, img_shape, direction):
flipped = bboxes.copy()
if direction == 'horizontal':
flipped[:, 0] = img_shape[1] - bboxes[:, 0] - 1
flipped[:4] = flipped[[1, 0, 3, 2]].copy()
elif direction == 'vertical':
flipped[:, 1] = img_shape[0] - bboxes[:, 1] - 1
flipped[:4] = flipped[[1, 0, 3, 2]].copy()
elif direction == 'diagonal':
flipped[:, 0] = img_shape[1] - bboxes[:, 0] - 1
flipped[:, 1] = img_shape[0] - bboxes[:, 1] - 1
Expand Down Expand Up @@ -271,7 +273,6 @@ def __call__(self, results):
def __repr__(self):
repr_str = self.__class__.__name__
repr_str += f'(rotate_ratio={self.rotate_ratio}, ' \
f'base_angles={self.base_angles}, ' \
f'angles_range={self.angles_range}, ' \
f'auto_bound={self.auto_bound})'
return repr_str
Expand Down

0 comments on commit b1ea012

Please sign in to comment.