From ab45b19e7e17c94d602d9198e85bc3d01980af59 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Thu, 15 Aug 2024 21:56:51 +0300 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20mask=5Fto=5Fxyxy=20fo?= =?UTF-8?q?r=20make=20boundingbox=20possible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- supervision/detection/core.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 9516c77e..a2af7941 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -268,9 +268,10 @@ class Detections: ) if hasattr(ultralytics_results, "boxes") and ultralytics_results.boxes is None: + masks = extract_ultralytics_masks(ultralytics_results) return cls( - xyxy=np.zeros((len(ultralytics_results), 4)), - mask=extract_ultralytics_masks(ultralytics_results), + xyxy=mask_to_xyxy(masks), + mask=masks, class_id=np.arange(len(ultralytics_results)), )