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
47b9dd04
Commit
47b9dd04
authored
Dec 16, 2020
by
A. Unique TensorFlower
Committed by
TF Object Detection Team
Dec 16, 2020
Browse files
Makes sure relevant fields are converted to float.
PiperOrigin-RevId: 347837387
parent
f1789115
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
research/object_detection/metrics/oid_challenge_evaluation_utils.py
...bject_detection/metrics/oid_challenge_evaluation_utils.py
+8
-9
No files found.
research/object_detection/metrics/oid_challenge_evaluation_utils.py
View file @
47b9dd04
...
@@ -56,10 +56,9 @@ def _decode_raw_data_into_masks_and_boxes(segments, image_widths,
...
@@ -56,10 +56,9 @@ def _decode_raw_data_into_masks_and_boxes(segments, image_widths,
"""Decods binary segmentation masks into np.arrays and boxes.
"""Decods binary segmentation masks into np.arrays and boxes.
Args:
Args:
segments: pandas Series object containing either
segments: pandas Series object containing either None entries, or strings
None entries, or strings with
with base64, zlib compressed, COCO RLE-encoded binary masks. All masks are
base64, zlib compressed, COCO RLE-encoded binary masks.
expected to be the same size.
All masks are expected to be the same size.
image_widths: pandas Series of mask widths.
image_widths: pandas Series of mask widths.
image_heights: pandas Series of mask heights.
image_heights: pandas Series of mask heights.
...
@@ -136,15 +135,15 @@ def build_groundtruth_dictionary(data, class_label_map):
...
@@ -136,15 +135,15 @@ def build_groundtruth_dictionary(data, class_label_map):
dictionary
=
{
dictionary
=
{
standard_fields
.
InputDataFields
.
groundtruth_boxes
:
standard_fields
.
InputDataFields
.
groundtruth_boxes
:
data_location
[[
'YMin'
,
'XMin'
,
'YMax'
,
'XMax'
]].
to_numpy
(),
data_location
[[
'YMin'
,
'XMin'
,
'YMax'
,
'XMax'
]].
to_numpy
().
astype
(
float
),
standard_fields
.
InputDataFields
.
groundtruth_classes
:
standard_fields
.
InputDataFields
.
groundtruth_classes
:
data_location
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]
data_location
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]
).
to_numpy
(),
).
to_numpy
(),
standard_fields
.
InputDataFields
.
groundtruth_group_of
:
standard_fields
.
InputDataFields
.
groundtruth_group_of
:
data_location
[
'IsGroupOf'
].
to_numpy
().
astype
(
int
),
data_location
[
'IsGroupOf'
].
to_numpy
().
astype
(
int
),
standard_fields
.
InputDataFields
.
groundtruth_image_classes
:
standard_fields
.
InputDataFields
.
groundtruth_image_classes
:
data_labels
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]
data_labels
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]).
to_numpy
(),
).
to_numpy
(),
}
}
if
'Mask'
in
data_location
:
if
'Mask'
in
data_location
:
...
@@ -181,7 +180,7 @@ def build_predictions_dictionary(data, class_label_map):
...
@@ -181,7 +180,7 @@ def build_predictions_dictionary(data, class_label_map):
standard_fields
.
DetectionResultFields
.
detection_classes
:
standard_fields
.
DetectionResultFields
.
detection_classes
:
data
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]).
to_numpy
(),
data
[
'LabelName'
].
map
(
lambda
x
:
class_label_map
[
x
]).
to_numpy
(),
standard_fields
.
DetectionResultFields
.
detection_scores
:
standard_fields
.
DetectionResultFields
.
detection_scores
:
data
[
'Score'
].
to_numpy
()
data
[
'Score'
].
to_numpy
()
.
astype
(
float
)
}
}
if
'Mask'
in
data
:
if
'Mask'
in
data
:
...
@@ -192,6 +191,6 @@ def build_predictions_dictionary(data, class_label_map):
...
@@ -192,6 +191,6 @@ def build_predictions_dictionary(data, class_label_map):
else
:
else
:
dictionary
[
standard_fields
.
DetectionResultFields
.
detection_boxes
]
=
data
[[
dictionary
[
standard_fields
.
DetectionResultFields
.
detection_boxes
]
=
data
[[
'YMin'
,
'XMin'
,
'YMax'
,
'XMax'
'YMin'
,
'XMin'
,
'YMax'
,
'XMax'
]].
to_numpy
()
]].
to_numpy
()
.
astype
(
float
)
return
dictionary
return
dictionary
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