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
43539545
Commit
43539545
authored
Oct 19, 2020
by
A. Unique TensorFlower
Browse files
Internal change
PiperOrigin-RevId: 337931726
parent
646c5755
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
official/vision/beta/evaluation/coco_evaluator.py
official/vision/beta/evaluation/coco_evaluator.py
+30
-26
No files found.
official/vision/beta/evaluation/coco_evaluator.py
View file @
43539545
...
@@ -190,42 +190,46 @@ class COCOEvaluator(object):
...
@@ -190,42 +190,46 @@ class COCOEvaluator(object):
if
hasattr
(
coco_eval
,
'category_stats'
):
if
hasattr
(
coco_eval
,
'category_stats'
):
for
category_index
,
category_id
in
enumerate
(
coco_eval
.
params
.
catIds
):
for
category_index
,
category_id
in
enumerate
(
coco_eval
.
params
.
catIds
):
coco_category
=
self
.
_coco_gt
.
cats
[
category_id
]
# if 'name' is available use it, otherwise use `id`
category_display_name
=
coco_category
.
get
(
'name'
,
category_id
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
0
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
0
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory@50IoU/{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory@50IoU/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
1
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
1
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory@75IoU/{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory@75IoU/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
2
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
2
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory (small) /{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory (small) /{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
3
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
3
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory (medium) /{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory (medium) /{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
4
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
4
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Precision mAP ByCategory (large) /{}'
.
format
(
metrics_dict
[
prefix
+
'Precision mAP ByCategory (large) /{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
5
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
5
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR@1 ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR@1 ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
6
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
6
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR@10 ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR@10 ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
7
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
7
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR@100 ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR@100 ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
8
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
8
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR (small) ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR (small) ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
9
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
9
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR (medium) ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR (medium) ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
10
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
10
][
category_index
].
astype
(
np
.
float32
)
metrics_dict
[
prefix
+
'Recall AR (large) ByCategory/{}'
.
format
(
metrics_dict
[
prefix
+
'Recall AR (large) ByCategory/{}'
.
format
(
category_
id
)]
=
coco_eval
.
category_stats
[
11
][
category_index
].
astype
(
category_
display_name
np
.
float32
)
)]
=
coco_eval
.
category_stats
[
11
][
category_index
].
astype
(
np
.
float32
)
return
metrics_dict
return
metrics_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