pytorch-retinanet
pytorch-retinanet copied to clipboard
question about nms
the nms doesn't according score ,why not according each class and score .
agreed.
Yes, I found each anchor Box just fetch the heightest score.Thant means when useing torchvision.ops.nms(boxes, scores, iou_threshold), the scores does not indicate the the same class. https://github.com/yhenon/pytorch-retinanet/blob/master/retinanet/model.py
` scores = torch.max(classification, dim=2, keepdim=True)[0]
scores_over_thresh = (scores > 0.05)[0, :, 0]
if scores_over_thresh.sum() == 0:
# no boxes to NMS, just return
return [torch.zeros(0), torch.zeros(0), torch.zeros(0, 4)]
classification = classification[:, scores_over_thresh, :]
transformed_anchors = transformed_anchors[:, scores_over_thresh, :]
scores = scores[:, scores_over_thresh, :]
anchors_nms_idx = nms(transformed_anchors[0,:,:], scores[0,:,0], 0.5)
`
should it be link that?
for i in range(class_num): nms(boxes, scores[i], iou_threshold)
Could you give us some advise? Thank you
MayBe the new commit has solved this issue. https://github.com/yhenon/pytorch-retinanet/commit/af6e78e6e27ceed1611888ae20c5fabc5ed5ae0f