PyTorch-YOLOv3
PyTorch-YOLOv3 copied to clipboard
Non-Max-Suppression
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) ""
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.
Thanks,I mistook it as the first score value of a tensor.