Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
MMCV
Commits
fadd915c
Unverified
Commit
fadd915c
authored
Jan 06, 2023
by
Zaida Zhou
Committed by
GitHub
Jan 06, 2023
Browse files
[Fix] _flip_keypoint of RandomFlip returns a wrong result (#2527)
parent
4ae327f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
mmcv/transforms/processing.py
mmcv/transforms/processing.py
+6
-3
No files found.
mmcv/transforms/processing.py
View file @
fadd915c
...
...
@@ -1203,7 +1203,8 @@ class RandomFlip(BaseTransform):
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.
"""
...
...
@@ -1239,7 +1240,8 @@ class RandomFlip(BaseTransform):
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.
"""
...
...
@@ -1259,7 +1261,7 @@ class RandomFlip(BaseTransform):
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
:
...
...
@@ -1357,6 +1359,7 @@ class RandomFlip(BaseTransform):
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment