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
20762ce9
Commit
20762ce9
authored
Oct 10, 2018
by
Kai Chen
Browse files
bug fix for proposal evaluation
parent
a6adf8f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
6 deletions
+15
-6
mmdet/core/evaluation/coco_utils.py
mmdet/core/evaluation/coco_utils.py
+2
-2
tools/test.py
tools/test.py
+13
-4
No files found.
mmdet/core/evaluation/coco_utils.py
View file @
20762ce9
...
@@ -16,8 +16,8 @@ def coco_eval(result_file, result_types, coco, max_dets=(100, 300, 1000)):
...
@@ -16,8 +16,8 @@ def coco_eval(result_file, result_types, coco, max_dets=(100, 300, 1000)):
coco
=
COCO
(
coco
)
coco
=
COCO
(
coco
)
assert
isinstance
(
coco
,
COCO
)
assert
isinstance
(
coco
,
COCO
)
if
res_type
==
'proposal_fast'
:
if
res
ult
_type
s
==
[
'proposal_fast'
]
:
ar
=
fast_eval_recall
(
result_file
,
coco
,
max_dets
)
ar
=
fast_eval_recall
(
result_file
,
coco
,
np
.
array
(
max_dets
)
)
for
i
,
num
in
enumerate
(
max_dets
):
for
i
,
num
in
enumerate
(
max_dets
):
print
(
'AR@{}
\t
= {:.4f}'
.
format
(
num
,
ar
[
i
]))
print
(
'AR@{}
\t
= {:.4f}'
.
format
(
num
,
ar
[
i
]))
return
return
...
...
tools/test.py
View file @
20762ce9
...
@@ -55,6 +55,9 @@ def parse_args():
...
@@ -55,6 +55,9 @@ def parse_args():
def
main
():
def
main
():
args
=
parse_args
()
args
=
parse_args
()
if
args
.
out
is
not
None
and
not
args
.
out
.
endswith
((
'.pkl'
,
'.pickle'
)):
raise
ValueError
(
'The output file must be a pkl file.'
)
cfg
=
mmcv
.
Config
.
fromfile
(
args
.
config
)
cfg
=
mmcv
.
Config
.
fromfile
(
args
.
config
)
cfg
.
model
.
pretrained
=
None
cfg
.
model
.
pretrained
=
None
cfg
.
data
.
test
.
test_mode
=
True
cfg
.
data
.
test
.
test_mode
=
True
...
@@ -82,11 +85,17 @@ def main():
...
@@ -82,11 +85,17 @@ def main():
dataset
,
_data_func
,
range
(
args
.
gpus
))
dataset
,
_data_func
,
range
(
args
.
gpus
))
if
args
.
out
:
if
args
.
out
:
print
(
'writing results to {}'
.
format
(
args
.
out
))
mmcv
.
dump
(
outputs
,
args
.
out
)
mmcv
.
dump
(
outputs
,
args
.
out
)
if
args
.
eval
:
eval_types
=
args
.
eval
json_file
=
args
.
out
+
'.json'
if
eval_types
:
results2json
(
dataset
,
outputs
,
json_file
)
print
(
'Starting evaluate {}'
.
format
(
' and '
.
join
(
eval_types
)))
coco_eval
(
json_file
,
args
.
eval
,
dataset
.
coco
)
if
eval_types
==
[
'proposal_fast'
]:
result_file
=
args
.
out
else
:
result_file
=
args
.
out
+
'.json'
results2json
(
dataset
,
outputs
,
result_file
)
coco_eval
(
result_file
,
eval_types
,
dataset
.
coco
)
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
...
...
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