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

how to evaluate the map using coco metrix in custom dataset? #12323

Open
luoshiyong opened this issue Mar 10, 2025 · 1 comment
Open

how to evaluate the map using coco metrix in custom dataset? #12323

luoshiyong opened this issue Mar 10, 2025 · 1 comment
Assignees

Comments

@luoshiyong
Copy link

``i had implement a custom dataset in instance segmentation ,which labels is labelme json, but in mmdet ,there is no evaluation metric for labelme json, so i modified the coco metrix as follows: val_evaluator = dict( type='CisdiMetric', ann_file=None, metric=['bbox', 'segm'], format_only=False, backend_args=backend_args) test_evaluator = val_evaluator , and in metrics, i use the following code to get the `gt,if self._coco_api is None:
# TODO: Need to refactor to support LoadAnnotations
assert 'gt_instances' in data_sample,
'ground truth is required for evaluation when '
'`ann_file` is not provided'
gt['anns'] = []
# print(data_sample)
boxes = data_sample['gt_instances']['bboxes'].detach().cpu().numpy()
labels = data_sample['gt_instances']['labels'].detach().cpu().numpy()
masks = [] if data_sample['gt_instances'].get('masks',None) is None else data_sample['gt_instances']['masks'].raw_masks
# print(data_sample['gt_instances']['masks'])
for bbox, label, mask in zip(boxes, labels, masks):
gt['anns'].append({'bbox': bbox, 'bbox_label': label,"mask":mask})
# gt['anns'] = data_sample['gt_instances']
# add converted result to the results list
self.results.append((gt, result))`, but the result is all map is 0,

@luoshiyong
Copy link
Author

Image

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

2 participants