Skip to content

Boxes with negative scores in NMS input? #3198

Closed
@masahi

Description

@masahi

Hi, I found that the use of NMS in RegionProposalNetwork can take on boxes with negative scores as inputs. I found this when running MaskRCNN in v0.8 release.

keep = box_ops.batched_nms(boxes, scores, lvl, self.nms_thresh)

In other use of NMS in ROIHeads, scores are thresholded to keep only boxes with positive scores:

inds = torch.where(scores > self.score_thresh)[0]

I'm wondering if that lack of score thresholding in RPN is intentional or not... In TVM, we expects NMS input with negative scores to be invalid. Since NMS in PyTorch doesn't have a score threshold parameter, we didn't realize that there could be boxes with negative scores.

I proposed to fix TVM's NMS conversion in apache/tvm#7137, but since it would have a big performance implication and I heard that negative boxes don't matter in the final output anyway, I'm now inclined not to fix this in TVM side.

cc @fmassa @t-vi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions