Revert np.bool comparisons with is

* Ruff complains when `== True` is used
* Different behaviour with `is True`
This commit is contained in:
Linas Kondrackis committed 2024-05-15 11:48:48 +03:00
1 parent 53f345e916
commit 0e2eec08c8
1 file changed
+3 -3
+3 -3
View File
@@ -308,9 +308,9 @@ def box_non_max_merge(
ious = box_iou_batch(predictions[order][:, :4], merge_candidate[:, :4])
below_threshold = ious < iou_threshold
matched_box_indices = np.flip(order[np.where(below_threshold is False)[0]])
unmatched_indices = order[np.where(below_threshold is True)[0]]
below_threshold = (ious < iou_threshold).astype(np.uint8)
matched_box_indices = np.flip(order[np.where(below_threshold == 0)[0]])
unmatched_indices = order[np.where(below_threshold == 1)[0]]
order = unmatched_indices[scores[unmatched_indices].argsort()]