Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support eval with custom dataset #1131

Merged
merged 3 commits into from
Feb 21, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor code
  • Loading branch information
ArMaxik committed Feb 18, 2022
commit 81eb92135f282242551439aaf0495c3eab1439fb
10 changes: 6 additions & 4 deletions yolox/evaluators/coco_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,14 @@ def evaluate_prediction(self, data_dict, statistics):
with contextlib.redirect_stdout(redirect_string):
cocoEval.summarize()
info += redirect_string.getvalue()
datasetCatsIds = list(cocoGt.cats.keys())
datasetCatsNames = [cocoGt.cats[catId]['name'] for catId in sorted(datasetCatsIds)]
cat_ids = list(cocoGt.cats.keys())
cat_names = [cocoGt.cats[catId]['name'] for catId in sorted(cat_ids)]
if self.per_class_AP:
info += "per class AP:\n" + per_class_AP_table(cocoEval, class_names=datasetCatsNames) + "\n"
per_class_AP_table_str = per_class_AP_table(cocoEval, class_names=cat_names)
ArMaxik marked this conversation as resolved.
Show resolved Hide resolved
info += "per class AP:\n" + per_class_AP_table_str + "\n"
if self.per_class_AR:
info += "per class AR:\n" + per_class_AR_table(cocoEval, class_names=datasetCatsNames) + "\n"
per_class_AR_table_str = per_class_AR_table(cocoEval, class_names=cat_names)
info += "per class AR:\n" + per_class_AR_table_str + "\n"
return cocoEval.stats[0], cocoEval.stats[1], info
else:
return 0, 0, info