Skip to content

Commit

Permalink
Merge 6f82596 into 4ae327f
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouzaida committed Jan 6, 2023
2 parents 4ae327f + 6f82596 commit d235bdf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions mmcv/transforms/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,8 @@ def _flip_bbox(self, bboxes: np.ndarray, img_shape: Tuple[int, int],
bboxes (numpy.ndarray): Bounding boxes, shape (..., 4*k)
img_shape (tuple[int]): Image shape (height, width)
direction (str): Flip direction. Options are 'horizontal',
'vertical'.
'vertical', and 'diagonal'.
Returns:
numpy.ndarray: Flipped bounding boxes.
"""
Expand Down Expand Up @@ -1239,7 +1240,8 @@ def _flip_keypoints(
keypoints (numpy.ndarray): Keypoints, shape (..., 2)
img_shape (tuple[int]): Image shape (height, width)
direction (str): Flip direction. Options are 'horizontal',
'vertical'.
'vertical', and 'diagonal'.
Returns:
numpy.ndarray: Flipped keypoints.
"""
Expand All @@ -1259,7 +1261,7 @@ def _flip_keypoints(
raise ValueError(
f"Flipping direction must be 'horizontal', 'vertical', \
or 'diagonal', but got '{direction}'")
flipped = np.concatenate([keypoints, meta_info], axis=-1)
flipped = np.concatenate([flipped, meta_info], axis=-1)
return flipped

def _flip_seg_map(self, seg_map: dict, direction: str) -> np.ndarray:
Expand Down Expand Up @@ -1357,6 +1359,7 @@ def transform(self, results: dict) -> dict:
Args:
results (dict): Result dict from loading pipeline.
Returns:
dict: Flipped results, 'img', 'gt_bboxes', 'gt_seg_map',
'gt_keypoints', 'flip', and 'flip_direction' keys are
Expand Down

0 comments on commit d235bdf

Please sign in to comment.