PyTorch-YOLOv3 icon indicating copy to clipboard operation
PyTorch-YOLOv3 copied to clipboard

Non-Max-Suppression

Open EddieEduardo opened this issue 5 years ago • 2 comments

I'm still confused about one place in utils.py/non_max_suppression

Line244-Line246 "" score = image_pred[ : , 4] * image_pred[ : , 5 :].max(1)[0]

Sore by it

image_pred = image_pred[ (-score).argsort() ] "" The place I'm confused about is [0] after max(1) , why it has to be like this way rather than "" score = image_pred[ : , 4] * image_pred[ : , 5 :].max(1) ""

EddieEduardo avatar Dec 03 '19 02:12 EddieEduardo

tensor.max(1) will return the score and its corresponding index, together. Here we just want to get the score, which has the index of 0.

pandalgx avatar Dec 08 '19 13:12 pandalgx

Thanks,I mistook it as the first score value of a tensor.

EddieEduardo avatar Dec 16 '19 12:12 EddieEduardo