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

COCOEvaluator类与get_detection_dataset_dicts函数接受变量不一致,导致多个数据集不能同时用COCOEvaluator进行验证 #348

Open
Abin0217 opened this issue Jun 11, 2024 · 0 comments

Comments

@Abin0217
Copy link

COCOEvaluator这个类接受的是数据集名称(str),get_detection_dataset_dicts这个函数接受的是数据集名称或者数据集列表(str or list),当get_detection_dataset_dicts接受列表变量时,COCOEvaluator不能正确获取输入
`
dataloader.test = L(build_detection_test_loader)(
dataset=L(get_detection_dataset_dicts)(names=test_list, filter_empty=False),
mapper=L(DetrDatasetMapper)(
augmentation=[
L(T.ResizeShortestEdge)(
short_edge_length=800,
max_size=1333,
),
],
augmentation_with_crop=None,
is_train=False,
mask_on=False,
img_format="RGB",
),
num_workers=4,
)

dataloader.evaluator = L(COCOEvaluator)(
dataset_name="${..test.dataset.names}",
)

def get_detection_dataset_dicts(
names,
filter_empty=True,
min_keypoints=0,
proposal_files=None,
check_consistency=True,
):
"""
Load and prepare dataset dicts for instance detection/segmentation and semantic segmentation.

Args:
    names (str or list[str]): a dataset name or a list of dataset names
    filter_empty (bool): whether to filter out images without instance annotations
    min_keypoints (int): filter out images with fewer keypoints than
        `min_keypoints`. Set to 0 to do nothing.
    proposal_files (list[str]): if given, a list of object proposal files
        that match each dataset in `names`.
    check_consistency (bool): whether to check if datasets have consistent metadata.

Returns:
    list[dict]: a list of dicts following the standard dataset dict format.
"""


class COCOEvaluator(DatasetEvaluator):
"""
Evaluate AR for object proposals, AP for instance detection/segmentation, AP
for keypoint detection outputs using COCO's metrics.
See http://cocodataset.org/#detection-eval and
http://cocodataset.org/#keypoints-eval to understand its metrics.
The metrics range from 0 to 100 (instead of 0 to 1), where a -1 or NaN means
the metric cannot be computed (e.g. due to no predictions made).

In addition to COCO, this evaluator is able to support any bounding box detection,
instance segmentation, or keypoint detection dataset.
"""

`

@Abin0217 Abin0217 changed the title COCOEvaluator类与get_detection_dataset_dicts函数接受变量不一致 COCOEvaluator类与get_detection_dataset_dicts函数接受变量不一致,导致多个数据集不能同时用COCOEvaluator进行验证 Jun 11, 2024
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

No branches or pull requests

1 participant