Open waddington-ou-phd-1 opened 3 years ago
Hi @waddington-ou-phd-1 , Thanks for your kind suggestion. There are two situations for that. 1. If the area is calculated from the mask, this usually means that we will do instance segmentation with the data, at this time, filtering zero-area mask is necessary. 2. If the area is calculated from bonding boxes, this usually means we are performing detection only tasks. However, at this time we still need to filter out empty boxes to avoid errors.
But you are right, the filtering logic for COCODataset
is kind of specialized for COCO dataset and may not be applicable for some customized needs. We indeed have plans to refactoring the data filtering logic in the future, but this may take some time.
Hi @ZwwWayne ,
I have some counter questions as I still think that the area property is only for segmentation masks:
Any update on this?
Any update on this?
Thanks for your error report and we appreciate it a lot.
Describe the bug
Line 146 and 147 of
mmdet/datasets/coco.py
https://github.com/open-mmlab/mmdetection/blob/master/mmdet/datasets/coco.py#L146 is:If the area property is 0, or does not exist, then this code will skip over the adding of bbox information to gt_bboxes, and the bbox here will not be used. Area is calculated from segmentation information according to MS COCO format guidelines, and has no relation to bounding boxes, and so this code should not be using area to filter for valid bboxes.
If the annotation is bounding boxes only, this code stops that bounding box from being used.
Bug fix I will create a PR for this if you agree that this is a bug and should not behave this way. My proposed solution is to move the first condition of
ann['area'] <= 0
to further down in the code to where the mask information is added to gt_masks_ann.