典型的用法
result = F.contrib.box_nms(
result, overlap_thresh=self.nms_thresh, topk=self.nms_topk,
valid_thresh=self.score_thresh,
id_index=0, score_index=1, coord_start=2, force_suppress=False)
result 是 (B, H_1 x W_1 x num_anchors x num_classes + ... + H_6 x W_6 x num_anchors x num_classes, 6) 的矩阵
在 box_nms 函数中,
r"""
topk : int, optional, default='-1'
Apply nms to topk boxes with descending scores, -1 to no restriction.
"""
topk 是指对依照 score 降序排列预测的 bbox 前多少个参与 nms,默认是 topk = 400
overlap_thresh 是指如果跟 score 更高的 bbox 的 iou 超过 overlap_thresh 就会被忽略
valid_thresh 是 score 的 thresh
post_nms 是最后输出