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
194d47c6
Commit
194d47c6
authored
Aug 03, 2021
by
Frederick Liu
Committed by
A. Unique TensorFlower
Aug 03, 2021
Browse files
Internal change
PiperOrigin-RevId: 388550046
parent
f68d9962
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
official/vision/beta/evaluation/coco_utils.py
official/vision/beta/evaluation/coco_utils.py
+2
-2
No files found.
official/vision/beta/evaluation/coco_utils.py
View file @
194d47c6
...
@@ -131,7 +131,6 @@ def convert_predictions_to_coco_annotations(predictions):
...
@@ -131,7 +131,6 @@ def convert_predictions_to_coco_annotations(predictions):
"""
"""
coco_predictions
=
[]
coco_predictions
=
[]
num_batches
=
len
(
predictions
[
'source_id'
])
num_batches
=
len
(
predictions
[
'source_id'
])
batch_size
=
predictions
[
'source_id'
][
0
].
shape
[
0
]
max_num_detections
=
predictions
[
'detection_classes'
][
0
].
shape
[
1
]
max_num_detections
=
predictions
[
'detection_classes'
][
0
].
shape
[
1
]
use_outer_box
=
'detection_outer_boxes'
in
predictions
use_outer_box
=
'detection_outer_boxes'
in
predictions
for
i
in
range
(
num_batches
):
for
i
in
range
(
num_batches
):
...
@@ -144,6 +143,7 @@ def convert_predictions_to_coco_annotations(predictions):
...
@@ -144,6 +143,7 @@ def convert_predictions_to_coco_annotations(predictions):
else
:
else
:
mask_boxes
=
predictions
[
'detection_boxes'
]
mask_boxes
=
predictions
[
'detection_boxes'
]
batch_size
=
predictions
[
'source_id'
][
i
].
shape
[
0
]
for
j
in
range
(
batch_size
):
for
j
in
range
(
batch_size
):
if
'detection_masks'
in
predictions
:
if
'detection_masks'
in
predictions
:
image_masks
=
mask_ops
.
paste_instance_masks
(
image_masks
=
mask_ops
.
paste_instance_masks
(
...
@@ -211,9 +211,9 @@ def convert_groundtruths_to_coco_dataset(groundtruths, label_map=None):
...
@@ -211,9 +211,9 @@ def convert_groundtruths_to_coco_dataset(groundtruths, label_map=None):
gt_annotations
=
[]
gt_annotations
=
[]
num_batches
=
len
(
groundtruths
[
'source_id'
])
num_batches
=
len
(
groundtruths
[
'source_id'
])
batch_size
=
groundtruths
[
'source_id'
][
0
].
shape
[
0
]
for
i
in
range
(
num_batches
):
for
i
in
range
(
num_batches
):
max_num_instances
=
groundtruths
[
'classes'
][
i
].
shape
[
1
]
max_num_instances
=
groundtruths
[
'classes'
][
i
].
shape
[
1
]
batch_size
=
groundtruths
[
'source_id'
][
i
].
shape
[
0
]
for
j
in
range
(
batch_size
):
for
j
in
range
(
batch_size
):
num_instances
=
groundtruths
[
'num_detections'
][
i
][
j
]
num_instances
=
groundtruths
[
'num_detections'
][
i
][
j
]
if
num_instances
>
max_num_instances
:
if
num_instances
>
max_num_instances
:
...
...
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