Skip to content
Snippets Groups Projects
Commit 8d010d7d authored by Cao Yuhang's avatar Cao Yuhang Committed by Kai Chen
Browse files

Fix bug when using coco_eval evaluate (#1367)

* fix bug when using coco_eval evaluate

* raise TypeError
parent 144a7ec4
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,12 @@ def coco_eval(result_files, result_types, coco, max_dets=(100, 300, 1000)):
return
for res_type in result_types:
result_file = result_files[res_type]
if isinstance(result_files, str):
result_file = result_files
elif isinstance(result_files, dict):
result_file = result_files[res_type]
else:
assert TypeError('result_files must be a str or dict')
assert result_file.endswith('.json')
coco_dets = coco.loadRes(result_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment