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

[Feature] Add COCO Metric #23

Merged
merged 26 commits into from
Oct 25, 2022
Merged

[Feature] Add COCO Metric #23

merged 26 commits into from
Oct 25, 2022

Conversation

BIGWangYuDong
Copy link
Collaborator

@BIGWangYuDong BIGWangYuDong commented Oct 19, 2022

Continue #9
Related PR: open-mmlab/mmdetection#9079

Before refactor:

image

After refactor:

Not load ann_file:

The area in coco is based on gt_mask. if using gt_bbox, it will lead to different small/medium/large AP results. Moreover, the area calculated from gt_mask area in CocoDetectionMetric is almost equal to coco-json file (still a little difference in small AP). So if only calculate bbox ap, and do not load ann_file, it is suggested to load mask at the same time.

Using gt_box area:
image

Using gt_mask area:
image

Load ann_file:

image

mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
mmeval/metrics/coco.py Outdated Show resolved Hide resolved
@BIGWangYuDong
Copy link
Collaborator Author

UT all passed locally
image

@BIGWangYuDong
Copy link
Collaborator Author

Kindly ping @RangiLyu have a look

Copy link
Collaborator

@ice-tong ice-tong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mmeval/metrics/coco_detection.py Outdated Show resolved Hide resolved
iou_thrs (float | List[float], optional): IoU threshold to compute AP
and AR. If not specified, IoUs from 0.5 to 0.95 will be used.
Defaults to None.
classwise_result (bool): Whether to return the computed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply using classwise is fine, eval_classwise or return_classwise might also be OK.
For now, classwise_results does not provide more meaningful information than classwise.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update all detection classwise_result -> classwise

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other metrics such as MeanIoU may also need to update

mmeval/metrics/coco_detection.py Outdated Show resolved Hide resolved
@zhouzaida zhouzaida merged commit 4306849 into main Oct 25, 2022
@zhouzaida zhouzaida deleted the wyd/coco branch October 25, 2022 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants