mmdetection
mmdetection copied to clipboard
The num_classes argument to the bbox2result function in mmdet\core\bboxtransforms.py
📚 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
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.
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.