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 DOTAMeanAP metric #65

Merged
merged 46 commits into from
Jan 28, 2023
Merged

Conversation

YanxingLiu
Copy link
Contributor

@YanxingLiu YanxingLiu commented Dec 11, 2022

Motivation

Add dota metric for rotated boxes evaluation

The PR link that use MMEval.DOTAMeanAP in mmrotate: open-mmlab/mmrotate#669

Modification

Add dota metric for rotated boxes evaluation

Use cases (Optional)

import numpy as np
from mmeval import DOTAMetric

num_classes = 15
dota_metric = DOTAMetric(num_classes=15)

def _gen_bboxes(num_bboxes, img_w=256, img_h=256):
    x = np.random.rand(num_bboxes, ) * img_w
    y = np.random.rand(num_bboxes, ) * img_h
    w = np.random.rand(num_bboxes, ) * (img_w - x)
    h = np.random.rand(num_bboxes, ) * (img_h - y)
    a = np.random.rand(num_bboxes, ) * np.pi / 2
    return np.stack([x, y, w, h, a], axis=1)

prediction = {
    'bboxes': _gen_bboxes(10),
    'scores': np.random.rand(10, ),
    'labels': np.random.randint(0, num_classes, size=(10, ))
}
groundtruth = {
    'bboxes': _gen_bboxes(10),
    'labels': np.random.randint(0, num_classes, size=(10, )),
    'bboxes_ignore': _gen_bboxes(5),
    'labels_ignore': np.random.randint(0, num_classes, size=(5, ))
}
dota_metric(predictions=[prediction, ], groundtruths=[groundtruth, ]) # doctest: +ELLIPSIS # noqa: E501

mmeval/metrics/dota_map.py Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_iou_rotated.py Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented Dec 13, 2022

CLA assistant check
All committers have signed the CLA.

mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
YanxingLiu and others added 5 commits December 20, 2022 15:13
change log warning level from info to debug to avoid warning repeatly

Co-authored-by: yancong <32220263+ice-tong@users.noreply.github.com>
Co-authored-by: yancong <32220263+ice-tong@users.noreply.github.com>
mmeval/metrics/end_point_error.py Outdated Show resolved Hide resolved
mmeval/metrics/voc_map.py Outdated Show resolved Hide resolved
@ice-tong ice-tong changed the title Add dota metric [CodeCamp #3] Add dota metric Dec 30, 2022
mmeval/metrics/end_point_error.py Outdated Show resolved Hide resolved
mmeval/metrics/end_point_error.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_overlaps_rotated.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_overlaps_rotated.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_overlaps_rotated.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_overlaps_rotated.py Outdated Show resolved Hide resolved
mmeval/metrics/utils/bbox_overlaps_rotated.py Outdated Show resolved Hide resolved
mmeval/metrics/dota_map.py Outdated Show resolved Hide resolved
@ice-tong
Copy link
Collaborator

ice-tong commented Jan 4, 2023

Please add the DOTAMeanAP API reference in docs/zh_cn/api/metrics.rst and docs/en/api/metrics.rst.

@ice-tong
Copy link
Collaborator

ice-tong commented Jan 4, 2023

Please @zytx121 have a look~

@ice-tong ice-tong changed the title [CodeCamp #3] Add dota metric [CodeCamp #3] Add DOTAMeanAP Jan 9, 2023
YanxingLiu and others added 5 commits January 19, 2023 08:46
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Conflicts:
	docs/en/api/metrics.rst
	docs/zh_cn/api/metrics.rst
	mmeval/metrics/__init__.py
YanxingLiu and others added 3 commits January 25, 2023 12:49
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
YanxingLiu and others added 4 commits January 25, 2023 16:08
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
@zhouzaida zhouzaida changed the title [CodeCamp #3] Add DOTAMeanAP [Feature] Add DOTAMeanAP Jan 28, 2023
@zhouzaida zhouzaida changed the title [Feature] Add DOTAMeanAP [Feature] Add DOTAMeanAP metric Jan 28, 2023
@zhouzaida zhouzaida merged commit d7846cd into open-mmlab:main Jan 28, 2023
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.

None yet

5 participants