Skip to content

Commit ce5b1c5

Browse files
XiaoliangDaifacebook-github-bot
authored andcommitted
Fix the coco_evaluation for keypoints
Summary: Fix the keypoint evaluation pipeline. Reviewed By: ppwwyyxx Differential Revision: D30904414 fbshipit-source-id: ef8bff166fccf2ef059013ae97ff119f8a9b4df0
1 parent 23f61b8 commit ce5b1c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

detectron2/evaluation/coco_evaluation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def __init__(
7676
By default in COCO, this limit is to 100, but this can be customized
7777
to be greater, as is needed in evaluation metrics AP fixed and AP pool
7878
(see https://arxiv.org/pdf/2102.01066.pdf)
79+
This doesn't affect keypoint evaluation.
7980
use_fast_impl (bool): use a fast but **unofficial** implementation to compute AP.
8081
Although the results should be very close to the official implementation in COCO
8182
API, it is still recommended to compute results with the official API for use in
@@ -585,7 +586,8 @@ def _evaluate_predictions_on_coco(
585586
# apply COCOevalMaxDets to evaluate AP with the custom input.
586587
if max_dets_per_image[2] != 100:
587588
coco_eval = COCOevalMaxDets(coco_gt, coco_dt, iou_type)
588-
coco_eval.params.maxDets = max_dets_per_image
589+
if iou_type != "keypoints":
590+
coco_eval.params.maxDets = max_dets_per_image
589591

590592
if img_ids is not None:
591593
coco_eval.params.imgIds = img_ids

0 commit comments

Comments
 (0)