diff --git a/supervision/detection/utils.py b/supervision/detection/utils.py index 80743129..fb22fa1f 100644 --- a/supervision/detection/utils.py +++ b/supervision/detection/utils.py @@ -214,8 +214,8 @@ def mask_non_max_suppression_2( keep = np.ones(rows, dtype=bool) for i in range(rows): if keep[i]: - condition = (ious[i] > iou_threshold) & (categories == category) - keep[i + 1:] = np.where(condition[i + 1:], False, keep[i + 1:]) + condition = (ious[i] > iou_threshold) & (category[i] == categories) + keep[i + 1 :] = np.where(condition[i + 1 :], False, keep[i + 1 :]) return keep