test=develop fix bug: fix selected_indices in nms (#17140)

feature/fluid_trt_int8
Jiancheng Li 6 years ago committed by lujun
parent 3acb3635c2
commit 554d3a71d2

@ -81,6 +81,7 @@ def nms(boxes,
sorted_indices = np.argsort(-all_scores, axis=0, kind='mergesort') sorted_indices = np.argsort(-all_scores, axis=0, kind='mergesort')
sorted_scores = all_scores[sorted_indices] sorted_scores = all_scores[sorted_indices]
sorted_indices = selected_indices[sorted_indices]
if top_k > -1 and top_k < sorted_indices.shape[0]: if top_k > -1 and top_k < sorted_indices.shape[0]:
sorted_indices = sorted_indices[:top_k] sorted_indices = sorted_indices[:top_k]
sorted_scores = sorted_scores[:top_k] sorted_scores = sorted_scores[:top_k]

Loading…
Cancel
Save