CornerNet-Lite
CornerNet-Lite copied to clipboard
Duplicated boxes during soft_nms
Whilst going through your code in order to try and understand your results, I noticed that in your test code you do not use the resulting keep
list from the soft_nms algorithm.
However, if I correctly understand the algorithm, it seems that whenever a box score gets below a certain threshold (0.001
by default), it gets removed from the list by swapping it with the last box from the list and decreasing the number of detections N.
At the end of the algorithm, they return a list with indices of valid detections to keep, but since you do not use it to filter the list, this results in some detections showing double, because the algorithm overwrites low scoring detections with another one.
I quickly tested my hypothesis by modifying this line of code:
# Note that since keep is just a list of increasing numbers [0,1,2,3,...]
# you could probable simplify this code by writing top_bboxes[j+1][:len(keep)]
keep = soft_nms(top_bboxes[j + 1], Nt=nms_threshold, method=nms_algorithm)
top_bboxes[j + 1] = top_bboxes[j+1][np.array(keep, dtype=np.int64)]
I tested this code on a single image and it indeed gives a different result, which makes me believe that there seems to be something weird going on. I don't know whether this change makes the results better or worse, but if my analysis is correct, this seems to be a mistake nonetheless.
Whilst going through your code in order to try and understand your results, I noticed that in your test code you do not use the resulting
keep
list from the soft_nms algorithm.However, if I correctly understand the algorithm, it seems that whenever a box score gets below a certain threshold (
0.001
by default), it gets removed from the list by swapping it with the last box from the list and decreasing the number of detections N. At the end of the algorithm, they return a list with indices of valid detections to keep, but since you do not use it to filter the list, this results in some detections showing double, because the algorithm overwrites low scoring detections with another one.I quickly tested my hypothesis by modifying this line of code:
# Note that since keep is just a list of increasing numbers [0,1,2,3,...] # you could probable simplify this code by writing top_bboxes[j+1][:len(keep)] keep = soft_nms(top_bboxes[j + 1], Nt=nms_threshold, method=nms_algorithm) top_bboxes[j + 1] = top_bboxes[j+1][np.array(keep, dtype=np.int64)]
I tested this code on a single image and it indeed gives a different result, which makes me believe that there seems to be something weird going on. I don't know whether this change makes the results better or worse, but if my analysis is correct, this seems to be a mistake nonetheless.
Hi,guys, I have some questions about the code in your question.and i want to ask you. can you give me your wechat number? Mine is 14704133471.