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
8db480c9
Commit
8db480c9
authored
Jun 20, 2020
by
syiming
Browse files
add shape test for get_box_classifier_feature_extractor_model
parent
ef68a826
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py
...er_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py
+11
-16
No files found.
research/object_detection/models/faster_rcnn_resnet_v1_fpn_keras_feature_extractor_tf2_test.py
View file @
8db480c9
...
@@ -87,22 +87,17 @@ class FasterRCNNResnetV1FPNKerasFeatureExtractorTest(tf.test.TestCase):
...
@@ -87,22 +87,17 @@ class FasterRCNNResnetV1FPNKerasFeatureExtractorTest(tf.test.TestCase):
feature_extractor
.
get_proposal_feature_extractor_model
(
feature_extractor
.
get_proposal_feature_extractor_model
(
name
=
'TestScope'
)(
preprocessed_inputs
)
name
=
'TestScope'
)(
preprocessed_inputs
)
# def test_extract_box_classifier_features_returns_expected_size(self):
def
test_extract_box_classifier_features_returns_expected_size
(
self
):
# feature_extractor = self._build_feature_extractor()
feature_extractor
=
self
.
_build_feature_extractor
()
# proposal_feature_maps = tf.random_uniform(
proposal_feature_maps
=
tf
.
random_uniform
(
# [3, 7, 7, 1024], maxval=255, dtype=tf.float32)
[
3
,
7
,
7
,
1024
],
maxval
=
255
,
dtype
=
tf
.
float32
)
# model = feature_extractor.get_box_classifier_feature_extractor_model(
model
=
feature_extractor
.
get_box_classifier_feature_extractor_model
(
# name='TestScope')
name
=
'TestScope'
)
# proposal_classifier_features = (
proposal_classifier_features
=
(
# model(proposal_feature_maps))
model
(
proposal_feature_maps
))
# features_shape = tf.shape(proposal_classifier_features)
features_shape
=
tf
.
shape
(
proposal_classifier_features
)
# # Note: due to a slight mismatch in slim and keras resnet definitions
# # the output shape of the box classifier is slightly different compared to
self
.
assertAllEqual
(
features_shape
.
numpy
(),
[
3
,
1024
])
# # that of the slim implementation. The keras version is more `canonical`
# # in that it more accurately reflects the original authors' implementation.
# # TODO(jonathanhuang): make the output shape match that of the slim
# # implementation by using atrous convolutions.
# self.assertAllEqual(features_shape.numpy(), [3, 4, 4, 2048])
if
__name__
==
'__main__'
:
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