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
SOLOv2-pytorch
Commits
893c4108
Unverified
Commit
893c4108
authored
Jan 30, 2019
by
Kai Chen
Committed by
GitHub
Jan 30, 2019
Browse files
Merge pull request #302 from tjsongzw/master
minor fix, print_map_summary
parents
554e20a2
e7a61063
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
mmdet/core/evaluation/mean_ap.py
mmdet/core/evaluation/mean_ap.py
+8
-4
No files found.
mmdet/core/evaluation/mean_ap.py
View file @
893c4108
import
mmcv
import
numpy
as
np
import
numpy
as
np
from
terminaltables
import
AsciiTable
from
terminaltables
import
AsciiTable
...
@@ -234,8 +235,9 @@ def eval_map(det_results,
...
@@ -234,8 +235,9 @@ def eval_map(det_results,
gt_ignore (list): gt ignore indicators of each image, a list of K array
gt_ignore (list): gt ignore indicators of each image, a list of K array
scale_ranges (list, optional): [(min1, max1), (min2, max2), ...]
scale_ranges (list, optional): [(min1, max1), (min2, max2), ...]
iou_thr (float): IoU threshold
iou_thr (float): IoU threshold
dataset (None or str): dataset name, there are minor differences in
dataset (None or str or list): dataset name or dataset classes, there
metrics for different datsets, e.g. "voc07", "imagenet_det", etc.
are minor differences in metrics for different datsets, e.g.
"voc07", "imagenet_det", etc.
print_summary (bool): whether to print the mAP summary
print_summary (bool): whether to print the mAP summary
Returns:
Returns:
...
@@ -333,7 +335,7 @@ def print_map_summary(mean_ap, results, dataset=None):
...
@@ -333,7 +335,7 @@ def print_map_summary(mean_ap, results, dataset=None):
Args:
Args:
mean_ap(float): calculated from `eval_map`
mean_ap(float): calculated from `eval_map`
results(list): calculated from `eval_map`
results(list): calculated from `eval_map`
dataset(None or str or list): dataset name.
dataset(None or str or list): dataset name
or dataset classes
.
"""
"""
num_scales
=
len
(
results
[
0
][
'ap'
])
if
isinstance
(
results
[
0
][
'ap'
],
num_scales
=
len
(
results
[
0
][
'ap'
])
if
isinstance
(
results
[
0
][
'ap'
],
np
.
ndarray
)
else
1
np
.
ndarray
)
else
1
...
@@ -353,8 +355,10 @@ def print_map_summary(mean_ap, results, dataset=None):
...
@@ -353,8 +355,10 @@ def print_map_summary(mean_ap, results, dataset=None):
if
dataset
is
None
:
if
dataset
is
None
:
label_names
=
[
str
(
i
)
for
i
in
range
(
1
,
num_classes
+
1
)]
label_names
=
[
str
(
i
)
for
i
in
range
(
1
,
num_classes
+
1
)]
el
se
:
el
if
mmcv
.
is_str
(
dataset
)
:
label_names
=
get_classes
(
dataset
)
label_names
=
get_classes
(
dataset
)
else
:
label_names
=
dataset
if
not
isinstance
(
mean_ap
,
list
):
if
not
isinstance
(
mean_ap
,
list
):
mean_ap
=
[
mean_ap
]
mean_ap
=
[
mean_ap
]
...
...
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