Commit 8a064338 authored by Rich Munoz's avatar Rich Munoz Committed by TF Object Detection Team
Browse files

Internal changes.

PiperOrigin-RevId: 355732989
parent ab7a0789
...@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment