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
3b0b6c01
Unverified
Commit
3b0b6c01
authored
Mar 09, 2022
by
Vasilis Vryniotis
Committed by
GitHub
Mar 09, 2022
Browse files
Fix minor issues with model tests. (#5576)
parent
57c8de7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
test/test_models.py
test/test_models.py
+2
-1
No files found.
test/test_models.py
View file @
3b0b6c01
...
@@ -81,7 +81,7 @@ def _get_expected_file(name=None):
...
@@ -81,7 +81,7 @@ def _get_expected_file(name=None):
# Note: for legacy reasons, the reference file names all had "ModelTest.test_" in their names
# Note: for legacy reasons, the reference file names all had "ModelTest.test_" in their names
# We hardcode it here to avoid having to re-generate the reference files
# We hardcode it here to avoid having to re-generate the reference files
expected_file
=
expected_file
=
os
.
path
.
join
(
expected_file_base
,
"ModelTester.test_"
+
name
)
expected_file
=
os
.
path
.
join
(
expected_file_base
,
"ModelTester.test_"
+
name
)
expected_file
+=
"_expect.pkl"
expected_file
+=
"_expect.pkl"
if
not
ACCEPT
and
not
os
.
path
.
exists
(
expected_file
):
if
not
ACCEPT
and
not
os
.
path
.
exists
(
expected_file
):
...
@@ -665,6 +665,7 @@ def test_detection_model(model_fn, dev):
...
@@ -665,6 +665,7 @@ def test_detection_model(model_fn, dev):
assert
len
(
out
)
==
1
assert
len
(
out
)
==
1
def
compact
(
tensor
):
def
compact
(
tensor
):
tensor
=
tensor
.
cpu
()
size
=
tensor
.
size
()
size
=
tensor
.
size
()
elements_per_sample
=
functools
.
reduce
(
operator
.
mul
,
size
[
1
:],
1
)
elements_per_sample
=
functools
.
reduce
(
operator
.
mul
,
size
[
1
:],
1
)
if
elements_per_sample
>
30
:
if
elements_per_sample
>
30
:
...
...
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