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
vision
Commits
03fec9c7
Unverified
Commit
03fec9c7
authored
Feb 10, 2021
by
Vasilis Vryniotis
Committed by
GitHub
Feb 10, 2021
Browse files
Fix flaky test_random_erasing test. (#3369)
parent
1b7c0f54
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
test/test_transforms.py
test/test_transforms.py
+3
-2
No files found.
test/test_transforms.py
View file @
03fec9c7
...
...
@@ -1955,6 +1955,7 @@ class Tester(unittest.TestCase):
img
=
transform
(
img
)
transform
.
__repr__
()
@
unittest
.
skipIf
(
stats
is
None
,
'scipy.stats not available'
)
def
test_random_erasing
(
self
):
img
=
torch
.
ones
(
3
,
128
,
128
)
...
...
@@ -1971,8 +1972,8 @@ class Tester(unittest.TestCase):
aspect_ratios
.
append
(
h
/
w
)
count_bigger_then_ones
=
len
([
1
for
aspect_ratio
in
aspect_ratios
if
aspect_ratio
>
1
])
count_smaller_then_ones
=
len
([
1
for
aspect_ratio
in
aspect_ratios
if
aspect_ratio
<
1
]
)
self
.
assert
AlmostEqual
(
count_bigger_then_ones
/
trial
,
count_smaller_then_ones
/
trial
,
1
)
p_value
=
stats
.
binom_test
(
count_bigger_then_ones
,
trial
,
p
=
0.5
)
self
.
assert
Greater
(
p_value
,
0.000
1
)
if
__name__
==
'__main__'
:
...
...
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