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
2e9bb539
Commit
2e9bb539
authored
Feb 25, 2021
by
stephenwu
Browse files
Merge branch 'master' of
https://github.com/tensorflow/models
into RTESuperGLUE
parents
7bae5317
8fba84f8
Changes
121
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
research/object_detection/utils/config_util_test.py
research/object_detection/utils/config_util_test.py
+61
-0
No files found.
research/object_detection/utils/config_util_test.py
View file @
2e9bb539
...
@@ -1018,6 +1018,67 @@ class ConfigUtilTest(tf.test.TestCase):
...
@@ -1018,6 +1018,67 @@ class ConfigUtilTest(tf.test.TestCase):
output_dict
,
output_dict
,
config_util
.
remove_unecessary_ema
(
input_dict
,
no_ema_collection
))
config_util
.
remove_unecessary_ema
(
input_dict
,
no_ema_collection
))
def
testUpdateRescoreInstances
(
self
):
pipeline_config_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"pipeline.config"
)
pipeline_config
=
pipeline_pb2
.
TrainEvalPipelineConfig
()
kpt_task
=
pipeline_config
.
model
.
center_net
.
keypoint_estimation_task
.
add
()
kpt_task
.
rescore_instances
=
True
_write_config
(
pipeline_config
,
pipeline_config_path
)
configs
=
config_util
.
get_configs_from_pipeline_file
(
pipeline_config_path
)
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
True
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
config_util
.
merge_external_params_with_configs
(
configs
,
kwargs_dict
=
{
"rescore_instances"
:
False
})
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
False
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
def
testUpdateRescoreInstancesWithBooleanString
(
self
):
pipeline_config_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"pipeline.config"
)
pipeline_config
=
pipeline_pb2
.
TrainEvalPipelineConfig
()
kpt_task
=
pipeline_config
.
model
.
center_net
.
keypoint_estimation_task
.
add
()
kpt_task
.
rescore_instances
=
True
_write_config
(
pipeline_config
,
pipeline_config_path
)
configs
=
config_util
.
get_configs_from_pipeline_file
(
pipeline_config_path
)
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
True
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
config_util
.
merge_external_params_with_configs
(
configs
,
kwargs_dict
=
{
"rescore_instances"
:
"False"
})
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
False
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
def
testUpdateRescoreInstancesWithMultipleTasks
(
self
):
pipeline_config_path
=
os
.
path
.
join
(
self
.
get_temp_dir
(),
"pipeline.config"
)
pipeline_config
=
pipeline_pb2
.
TrainEvalPipelineConfig
()
kpt_task
=
pipeline_config
.
model
.
center_net
.
keypoint_estimation_task
.
add
()
kpt_task
.
rescore_instances
=
True
kpt_task
=
pipeline_config
.
model
.
center_net
.
keypoint_estimation_task
.
add
()
kpt_task
.
rescore_instances
=
True
_write_config
(
pipeline_config
,
pipeline_config_path
)
configs
=
config_util
.
get_configs_from_pipeline_file
(
pipeline_config_path
)
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
True
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
config_util
.
merge_external_params_with_configs
(
configs
,
kwargs_dict
=
{
"rescore_instances"
:
False
})
cn_config
=
configs
[
"model"
].
center_net
self
.
assertEqual
(
True
,
cn_config
.
keypoint_estimation_task
[
0
].
rescore_instances
)
self
.
assertEqual
(
True
,
cn_config
.
keypoint_estimation_task
[
1
].
rescore_instances
)
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
tf
.
test
.
main
()
tf
.
test
.
main
()
Prev
1
…
3
4
5
6
7
Next
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