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
6304b647
Commit
6304b647
authored
Nov 07, 2019
by
Korabelnikov Aleks
Committed by
Kai Chen
Nov 08, 2019
Browse files
generalization of Expand transfrom probability (#1633)
Allows to use not only 0.5 probability.
parent
4b101ece
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
mmdet/datasets/pipelines/transforms.py
mmdet/datasets/pipelines/transforms.py
+5
-2
No files found.
mmdet/datasets/pipelines/transforms.py
View file @
6304b647
...
...
@@ -509,13 +509,15 @@ class Expand(object):
mean (tuple): mean value of dataset.
to_rgb (bool): if need to convert the order of mean to align with RGB.
ratio_range (tuple): range of expand ratio.
prob (float): probability of applying this transformation
"""
def
__init__
(
self
,
mean
=
(
0
,
0
,
0
),
to_rgb
=
True
,
ratio_range
=
(
1
,
4
),
seg_ignore_label
=
None
):
seg_ignore_label
=
None
,
prob
=
0.5
):
self
.
to_rgb
=
to_rgb
self
.
ratio_range
=
ratio_range
if
to_rgb
:
...
...
@@ -524,9 +526,10 @@ class Expand(object):
self
.
mean
=
mean
self
.
min_ratio
,
self
.
max_ratio
=
ratio_range
self
.
seg_ignore_label
=
seg_ignore_label
self
.
prob
=
prob
def
__call__
(
self
,
results
):
if
random
.
randint
(
2
)
:
if
random
.
uniform
(
0
,
1
)
>
self
.
prob
:
return
results
img
,
boxes
=
[
results
[
k
]
for
k
in
(
'img'
,
'gt_bboxes'
)]
...
...
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