From fa979cf0ab5228e793c8ee9abf488dcc498dd525 Mon Sep 17 00:00:00 2001 From: Jonas Pirner <48887249+pirnerjonas@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:36:33 +0100 Subject: [PATCH 1/2] docs: fix doc string in Detections merge function --- supervision/detection/core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index c61728b9c..7c3469b3b 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -1027,16 +1027,16 @@ def merge(cls, detections_list: List[Detections]) -> Detections: detections_1 = sv.Detections( xyxy=np.array([[15, 15, 100, 100], [200, 200, 300, 300]]), class_id=np.array([1, 2]), - data={'feature_vector': np.array([0.1, 0.2)])} - ) - + data={'feature_vector': np.array([0.1, 0.2])} + ) + detections_2 = sv.Detections( xyxy=np.array([[30, 30, 120, 120]]), class_id=np.array([1]), - data={'feature_vector': [np.array([0.3])]} - ) - - merged_detections = Detections.merge([detections_1, detections_2]) + data={'feature_vector': np.array([0.3])} + ) + + merged_detections = sv.Detections.merge([detections_1, detections_2]) merged_detections.xyxy array([[ 15, 15, 100, 100], From b2a1eb5b21baf89e92bc6ab95a48a86e7dfb5fab Mon Sep 17 00:00:00 2001 From: Jonas Pirner <48887249+pirnerjonas@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:46:25 +0100 Subject: [PATCH 2/2] fix: remove tabs --- supervision/detection/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 7c3469b3b..ca4ded1ff 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -1029,13 +1029,13 @@ def merge(cls, detections_list: List[Detections]) -> Detections: class_id=np.array([1, 2]), data={'feature_vector': np.array([0.1, 0.2])} ) - + detections_2 = sv.Detections( xyxy=np.array([[30, 30, 120, 120]]), class_id=np.array([1]), data={'feature_vector': np.array([0.3])} ) - + merged_detections = sv.Detections.merge([detections_1, detections_2]) merged_detections.xyxy