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
32d5a722
Commit
32d5a722
authored
Oct 06, 2020
by
A. Unique TensorFlower
Browse files
Fix ground truth annotation overflow.
PiperOrigin-RevId: 335759679
parent
85f52928
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
official/vision/beta/evaluation/coco_utils.py
official/vision/beta/evaluation/coco_utils.py
+6
-0
No files found.
official/vision/beta/evaluation/coco_utils.py
View file @
32d5a722
...
...
@@ -211,8 +211,14 @@ def convert_groundtruths_to_coco_dataset(groundtruths, label_map=None):
num_batches
=
len
(
groundtruths
[
'source_id'
])
batch_size
=
groundtruths
[
'source_id'
][
0
].
shape
[
0
]
for
i
in
range
(
num_batches
):
max_num_instances
=
groundtruths
[
'classes'
][
i
].
shape
[
1
]
for
j
in
range
(
batch_size
):
num_instances
=
groundtruths
[
'num_detections'
][
i
][
j
]
if
num_instances
>
max_num_instances
:
logging
.
warning
(
'num_groundtruths is larger than max_num_instances, %d v.s. %d'
,
num_instances
,
max_num_instances
)
num_instances
=
max_num_instances
for
k
in
range
(
int
(
num_instances
)):
ann
=
{}
ann
[
'image_id'
]
=
int
(
groundtruths
[
'source_id'
][
i
][
j
])
...
...
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