Skip to content

Commit

Permalink
[Fix] misspelling of 'flip' (#10746)
Browse files Browse the repository at this point in the history
  • Loading branch information
RangeKing committed Aug 7, 2023
1 parent cd88ad1 commit 5412e85
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions mmdet/datasets/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ def transform(self, results: dict) -> dict:
retrieve_img = retrieve_results['img']

jit_factor = random.uniform(*self.ratio_range)
is_filp = random.uniform(0, 1) > self.flip_ratio
is_flip = random.uniform(0, 1) > self.flip_ratio

if len(retrieve_img.shape) == 3:
out_img = np.ones(
Expand All @@ -2658,7 +2658,7 @@ def transform(self, results: dict) -> dict:
int(out_img.shape[0] * jit_factor)))

# 4. flip
if is_filp:
if is_flip:
out_img = out_img[:, ::-1, :]

# 5. random crop
Expand All @@ -2684,7 +2684,7 @@ def transform(self, results: dict) -> dict:
if self.bbox_clip_border:
retrieve_gt_bboxes.clip_([origin_h, origin_w])

if is_filp:
if is_flip:
retrieve_gt_bboxes.flip_([origin_h, origin_w],
direction='horizontal')

Expand Down Expand Up @@ -3728,7 +3728,7 @@ def transform(self, results: dict) -> dict:
with_mask = True if 'gt_masks' in results else False

jit_factor = random.uniform(*self.ratio_range)
is_filp = random.uniform(0, 1) > self.flip_ratio
is_flip = random.uniform(0, 1) > self.flip_ratio

if len(retrieve_img.shape) == 3:
out_img = np.ones(
Expand All @@ -3755,7 +3755,7 @@ def transform(self, results: dict) -> dict:
int(out_img.shape[0] * jit_factor)))

# 4. flip
if is_filp:
if is_flip:
out_img = out_img[:, ::-1, :]

# 5. random crop
Expand Down Expand Up @@ -3785,7 +3785,7 @@ def transform(self, results: dict) -> dict:
if self.bbox_clip_border:
retrieve_gt_bboxes.clip_([origin_h, origin_w])

if is_filp:
if is_flip:
retrieve_gt_bboxes.flip_([origin_h, origin_w],
direction='horizontal')
if with_mask:
Expand Down
2 changes: 1 addition & 1 deletion mmdet/models/test_time_augs/merge_augs.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def merge_aug_masks(aug_masks: List[Tensor],
weight = weights[i]
else:
weight = 1
flip = img_metas.get('filp', False)
flip = img_metas.get('flip', False)
if flip:
flip_direction = img_metas['flip_direction']
if flip_direction == 'horizontal':
Expand Down

0 comments on commit 5412e85

Please sign in to comment.