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
d5ae12e1
Commit
d5ae12e1
authored
Sep 30, 2021
by
A. Unique TensorFlower
Committed by
TF Object Detection Team
Sep 30, 2021
Browse files
Modify CenterNet to output extracted features.
PiperOrigin-RevId: 400090738
parent
e06d2c3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
research/object_detection/meta_architectures/center_net_meta_arch.py
...ject_detection/meta_architectures/center_net_meta_arch.py
+2
-0
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py
...ction/meta_architectures/center_net_meta_arch_tf2_test.py
+1
-0
No files found.
research/object_detection/meta_architectures/center_net_meta_arch.py
View file @
d5ae12e1
...
@@ -3805,6 +3805,7 @@ class CenterNetMetaArch(model.DetectionModel):
...
@@ -3805,6 +3805,7 @@ class CenterNetMetaArch(model.DetectionModel):
prediction_dict: a dictionary holding predicted tensors with
prediction_dict: a dictionary holding predicted tensors with
'preprocessed_inputs' - The input image after being resized and
'preprocessed_inputs' - The input image after being resized and
preprocessed by the feature extractor.
preprocessed by the feature extractor.
'extracted_features' - The output of the feature extractor.
'object_center' - A list of size num_feature_outputs containing
'object_center' - A list of size num_feature_outputs containing
float tensors of size [batch_size, output_height, output_width,
float tensors of size [batch_size, output_height, output_width,
num_classes] representing the predicted object center heatmap logits.
num_classes] representing the predicted object center heatmap logits.
...
@@ -3848,6 +3849,7 @@ class CenterNetMetaArch(model.DetectionModel):
...
@@ -3848,6 +3849,7 @@ class CenterNetMetaArch(model.DetectionModel):
predictions
[
head_name
]
=
[
predictions
[
head_name
]
=
[
head
(
feature
)
for
(
feature
,
head
)
in
zip
(
features_list
,
heads
)
head
(
feature
)
for
(
feature
,
head
)
in
zip
(
features_list
,
heads
)
]
]
predictions
[
'extracted_features'
]
=
features_list
predictions
[
'preprocessed_inputs'
]
=
preprocessed_inputs
predictions
[
'preprocessed_inputs'
]
=
preprocessed_inputs
self
.
_batched_prediction_tensor_names
=
predictions
.
keys
()
self
.
_batched_prediction_tensor_names
=
predictions
.
keys
()
...
...
research/object_detection/meta_architectures/center_net_meta_arch_tf2_test.py
View file @
d5ae12e1
...
@@ -3460,6 +3460,7 @@ class CenterNetMetaArch1dTest(test_case.TestCase, parameterized.TestCase):
...
@@ -3460,6 +3460,7 @@ class CenterNetMetaArch1dTest(test_case.TestCase, parameterized.TestCase):
postprocess_output
=
arch
.
postprocess
(
predictions
,
true_shapes
)
postprocess_output
=
arch
.
postprocess
(
predictions
,
true_shapes
)
losses_output
=
arch
.
loss
(
predictions
,
true_shapes
)
losses_output
=
arch
.
loss
(
predictions
,
true_shapes
)
self
.
assertIn
(
'extracted_features'
,
predictions
)
self
.
assertIn
(
'%s/%s'
%
(
cnma
.
LOSS_KEY_PREFIX
,
cnma
.
OBJECT_CENTER
),
self
.
assertIn
(
'%s/%s'
%
(
cnma
.
LOSS_KEY_PREFIX
,
cnma
.
OBJECT_CENTER
),
losses_output
)
losses_output
)
self
.
assertEqual
((),
losses_output
[
'%s/%s'
%
(
self
.
assertEqual
((),
losses_output
[
'%s/%s'
%
(
...
...
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