Skip to content

Commit

Permalink
Fixed bug in NMW method where confidence scores where decreased after…
Browse files Browse the repository at this point in the history
… ensemble.
  • Loading branch information
IDMIPPM committed Jun 28, 2020
1 parent c789f05 commit cab6f99
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ensemble_boxes/ensemble_boxes_nmw.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ def non_maximum_weighted(boxes_list, scores_list, labels_list, weights=None, iou
if len(weights) != len(boxes_list):
print('Warning: incorrect number of weights {}. Must be: {}. Set weights equal to 1.'.format(len(weights), len(boxes_list)))
weights = np.ones(len(boxes_list))
weights = np.array(weights)
for i in range(len(weights)):
scores_list[i] = (np.array(scores_list[i]) * weights[i]) / weights.sum()
weights = np.array(weights) / max(weights)
# for i in range(len(weights)):
# scores_list[i] = (np.array(scores_list[i]) * weights[i])

filtered_boxes = prefilter_boxes(boxes_list, scores_list, labels_list, weights, skip_box_thr)
if len(filtered_boxes) == 0:
Expand Down

0 comments on commit cab6f99

Please sign in to comment.