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
8a064338
Commit
8a064338
authored
Feb 04, 2021
by
Rich Munoz
Committed by
TF Object Detection Team
Feb 04, 2021
Browse files
Internal changes.
PiperOrigin-RevId: 355732989
parent
ab7a0789
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
research/object_detection/inputs.py
research/object_detection/inputs.py
+4
-3
No files found.
research/object_detection/inputs.py
View file @
8a064338
...
@@ -68,8 +68,9 @@ def _multiclass_scores_or_one_hot_labels(multiclass_scores,
...
@@ -68,8 +68,9 @@ def _multiclass_scores_or_one_hot_labels(multiclass_scores,
return
tf
.
cond
(
tf
.
size
(
multiclass_scores
)
>
0
,
true_fn
,
false_fn
)
return
tf
.
cond
(
tf
.
size
(
multiclass_scores
)
>
0
,
true_fn
,
false_fn
)
def
_convert_labeled_classes_to_k_hot
(
groundtruth_labeled_classes
,
num_classes
,
def
convert_labeled_classes_to_k_hot
(
groundtruth_labeled_classes
,
map_empty_to_ones
=
False
):
num_classes
,
map_empty_to_ones
=
False
):
"""Returns k-hot encoding of the labeled classes.
"""Returns k-hot encoding of the labeled classes.
If map_empty_to_ones is enabled and the input labeled_classes is empty,
If map_empty_to_ones is enabled and the input labeled_classes is empty,
...
@@ -235,7 +236,7 @@ def transform_input_data(tensor_dict,
...
@@ -235,7 +236,7 @@ def transform_input_data(tensor_dict,
if
field
in
out_tensor_dict
:
if
field
in
out_tensor_dict
:
out_tensor_dict
[
field
]
=
_remove_unrecognized_classes
(
out_tensor_dict
[
field
]
=
_remove_unrecognized_classes
(
out_tensor_dict
[
field
],
unrecognized_label
=-
1
)
out_tensor_dict
[
field
],
unrecognized_label
=-
1
)
out_tensor_dict
[
field
]
=
_
convert_labeled_classes_to_k_hot
(
out_tensor_dict
[
field
]
=
convert_labeled_classes_to_k_hot
(
out_tensor_dict
[
field
],
num_classes
,
map_empty_to_ones
)
out_tensor_dict
[
field
],
num_classes
,
map_empty_to_ones
)
if
input_fields
.
multiclass_scores
in
out_tensor_dict
:
if
input_fields
.
multiclass_scores
in
out_tensor_dict
:
...
...
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