mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

The num_classes argument to the bbox2result function in mmdet\core\bboxtransforms.py

Open Programmergg opened this issue 2 years ago • 2 comments

📚 The doc issue

In the annotation of this function, num_classes is described as including background class, but the actual usage does not include background class, should this be changed?

Suggest a potential alternative/fix

No response

Programmergg avatar Sep 18 '22 14:09 Programmergg

Hi @Programmergg , Thanks for your kind suggestion. Yes, it seems to be inconsistent. Would you like to point out the exact place (which line of which file)? It would also be great if you would like to create a PR.

ZwwWayne avatar Sep 19 '22 11:09 ZwwWayne

Hi @Programmergg , Thanks for your kind suggestion. Yes, it seems to be inconsistent. Would you like to point out the exact place (which line of which file)? It would also be great if you would like to create a PR.

This should be a minor error in the annotation. In line 122 of mmdet/core/bbox/transforms.py, it states ‘num_classes (int): class number, including background class’. But in line 258 of mmdet/models/ roi_heads/standard_roi_head.py, it uses self.bbox_head.num_classes, i.e.,without the background class. The original description should therefore be changed to 'num_classes (int): class number, excluding background class', which doesn't affect usage but can cause misunderstandings when calling the function.

Programmergg avatar Sep 19 '22 11:09 Programmergg