Vyacheslav Eliseev
Feng Wang
commited on
Commit
·
59d885b
1
Parent(s):
0a718d9
chore(evaluator): support custom dataset (#1131)
Browse fileschore(evaluator): support custom dataset
Co-authored-by: Feng Wang <[email protected]>
yolox/evaluators/coco_evaluator.py
CHANGED
@@ -280,10 +280,14 @@ class COCOEvaluator:
|
|
280 |
with contextlib.redirect_stdout(redirect_string):
|
281 |
cocoEval.summarize()
|
282 |
info += redirect_string.getvalue()
|
|
|
|
|
283 |
if self.per_class_AP:
|
284 |
-
|
|
|
285 |
if self.per_class_AR:
|
286 |
-
|
|
|
287 |
return cocoEval.stats[0], cocoEval.stats[1], info
|
288 |
else:
|
289 |
return 0, 0, info
|
|
|
280 |
with contextlib.redirect_stdout(redirect_string):
|
281 |
cocoEval.summarize()
|
282 |
info += redirect_string.getvalue()
|
283 |
+
cat_ids = list(cocoGt.cats.keys())
|
284 |
+
cat_names = [cocoGt.cats[catId]['name'] for catId in sorted(cat_ids)]
|
285 |
if self.per_class_AP:
|
286 |
+
AP_table = per_class_AP_table(cocoEval, class_names=cat_names)
|
287 |
+
info += "per class AP:\n" + AP_table + "\n"
|
288 |
if self.per_class_AR:
|
289 |
+
AR_table = per_class_AR_table(cocoEval, class_names=cat_names)
|
290 |
+
info += "per class AR:\n" + AR_table + "\n"
|
291 |
return cocoEval.stats[0], cocoEval.stats[1], info
|
292 |
else:
|
293 |
return 0, 0, info
|