diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 2ab9c204..4df3b560 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -1002,7 +1002,8 @@ class Detections: self, threshold: float = 0.5, class_agnostic: bool = False ) -> Detections: """ - Perform non-maximum suppression on the current set of object detections or segmentation prediction. + Perform non-maximum suppression on the current set + of object detections or segmentation prediction. Args: threshold (float, optional): The intersection-over-union threshold @@ -1031,8 +1032,8 @@ class Detections: predictions = np.hstack((self.xyxy, self.confidence.reshape(-1, 1))) else: assert self.class_id is not None, ( - "Detections class_id must be given for NMS to be executed. If you intended" - " to perform class agnostic NMS set class_agnostic=True." + "Detections class_id must be given for NMS to be executed. If you" + " intended to perform class agnostic NMS set class_agnostic=True." ) predictions = np.hstack( ( diff --git a/supervision/detection/utils.py b/supervision/detection/utils.py index 4aa9e34c..e5633423 100644 --- a/supervision/detection/utils.py +++ b/supervision/detection/utils.py @@ -113,7 +113,8 @@ def mask_non_max_suppression( non-maximum suppression. Raises: - AssertionError: If `iou_threshold` is not within the closed range from `0` to `1`. + AssertionError: If `iou_threshold` is not within the closed + range from `0` to `1`. """ assert 0 <= iou_threshold <= 1, ( "Value of `iou_threshold` must be in the closed range from 0 to 1, "