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
ResNet50_tensorflow
Commits
d96d2e3e
Commit
d96d2e3e
authored
Jul 23, 2020
by
Kaushik Shivakumar
Browse files
finish pylint
parent
fbe9b495
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
research/object_detection/matchers/hungarian_matcher.py
research/object_detection/matchers/hungarian_matcher.py
+2
-2
research/object_detection/matchers/hungarian_matcher_tf2_test.py
...h/object_detection/matchers/hungarian_matcher_tf2_test.py
+18
-14
No files found.
research/object_detection/matchers/hungarian_matcher.py
View file @
d96d2e3e
research/object_detection/matchers/hungarian_matcher_tf2_test.py
View file @
d96d2e3e
...
...
@@ -26,7 +26,7 @@ if tf_version.is_tf2():
@
unittest
.
skipIf
(
tf_version
.
is_tf1
(),
'Skipping TF2.X only test.'
)
class
Greedy
BipartiteMatcherTest
(
test_case
.
TestCase
):
class
Hungarian
BipartiteMatcherTest
(
test_case
.
TestCase
):
def
test_get_expected_matches_when_all_rows_are_valid
(
self
):
similarity_matrix
=
np
.
array
([[
0.50
,
0.1
,
0.8
],
[
0.15
,
0.2
,
0.3
]],
...
...
@@ -37,8 +37,8 @@ class GreedyBipartiteMatcherTest(test_case.TestCase):
matcher
=
hungarian_matcher
.
HungarianBipartiteMatcher
()
match_results_out
=
matcher
.
match
(
similarity_matrix
,
valid_rows
=
valid_rows
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
def
test_get_expected_matches_with_all_rows_be_default
(
self
):
similarity_matrix
=
np
.
array
([[
0.50
,
0.1
,
0.8
],
[
0.15
,
0.2
,
0.3
]],
...
...
@@ -48,7 +48,8 @@ class GreedyBipartiteMatcherTest(test_case.TestCase):
matcher
=
hungarian_matcher
.
HungarianBipartiteMatcher
()
match_results_out
=
matcher
.
match
(
similarity_matrix
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
def
test_get_no_matches_with_zero_valid_rows
(
self
):
similarity_matrix
=
np
.
array
([[
0.50
,
0.1
,
0.8
],
[
0.15
,
0.2
,
0.3
]],
...
...
@@ -59,7 +60,8 @@ class GreedyBipartiteMatcherTest(test_case.TestCase):
matcher
=
hungarian_matcher
.
HungarianBipartiteMatcher
()
match_results_out
=
matcher
.
match
(
similarity_matrix
,
valid_rows
=
valid_rows
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
def
test_get_expected_matches_with_only_one_valid_row
(
self
):
similarity_matrix
=
np
.
array
([[
0.50
,
0.1
,
0.8
],
[
0.15
,
0.2
,
0.3
]],
...
...
@@ -70,7 +72,8 @@ class GreedyBipartiteMatcherTest(test_case.TestCase):
matcher
=
hungarian_matcher
.
HungarianBipartiteMatcher
()
match_results_out
=
matcher
.
match
(
similarity_matrix
,
valid_rows
=
valid_rows
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
def
test_get_expected_matches_with_only_one_valid_row_at_bottom
(
self
):
similarity_matrix
=
np
.
array
([[
0.15
,
0.2
,
0.3
],
[
0.50
,
0.1
,
0.8
]],
...
...
@@ -81,7 +84,8 @@ class GreedyBipartiteMatcherTest(test_case.TestCase):
matcher
=
hungarian_matcher
.
HungarianBipartiteMatcher
()
match_results_out
=
matcher
.
match
(
similarity_matrix
,
valid_rows
=
valid_rows
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
self
.
assertAllEqual
(
match_results_out
.
_match_results
.
numpy
(),
expected_match_results
)
if
__name__
==
'__main__'
:
tf
.
test
.
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