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
ModelZoo
SOLOv2-pytorch
Commits
ebf499f2
"git@developer.sourcefind.cn:modelzoo/unet_migraphx.git" did not exist on "ce3462184bc0a97ad9d0c3304002e12a32b448f4"
Commit
ebf499f2
authored
Sep 12, 2019
by
Cao Yuhang
Committed by
Kai Chen
Sep 12, 2019
Browse files
add mask transform to Expand and MinIoURandomCrop (#1361)
parent
40ea9ca2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
mmdet/datasets/pipelines/transforms.py
mmdet/datasets/pipelines/transforms.py
+19
-0
No files found.
mmdet/datasets/pipelines/transforms.py
View file @
ebf499f2
...
...
@@ -531,6 +531,15 @@ class Expand(object):
results
[
'img'
]
=
expand_img
results
[
'gt_bboxes'
]
=
boxes
if
'gt_masks'
in
results
:
expand_gt_masks
=
[]
for
mask
in
results
[
'gt_masks'
]:
expand_mask
=
np
.
full
((
int
(
h
*
ratio
),
int
(
w
*
ratio
)),
0
).
astype
(
mask
.
dtype
)
expand_mask
[
top
:
top
+
h
,
left
:
left
+
w
]
=
mask
expand_gt_masks
.
append
(
expand_mask
)
results
[
'gt_masks'
]
=
expand_gt_masks
return
results
def
__repr__
(
self
):
...
...
@@ -604,6 +613,16 @@ class MinIoURandomCrop(object):
results
[
'img'
]
=
img
results
[
'gt_bboxes'
]
=
boxes
results
[
'gt_labels'
]
=
labels
if
'gt_masks'
in
results
:
valid_masks
=
[
results
[
'gt_masks'
][
i
]
for
i
in
range
(
len
(
mask
))
if
mask
[
i
]
]
results
[
'gt_masks'
]
=
[
gt_mask
[
patch
[
1
]:
patch
[
3
],
patch
[
0
]:
patch
[
2
]]
for
gt_mask
in
valid_masks
]
return
results
def
__repr__
(
self
):
...
...
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