From a7d2356be17255d372a47bb5e22074e3d44b49c6 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Wed, 6 Aug 2025 18:47:04 +0200 Subject: [PATCH] test --- supervision/detection/core.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index ffe5ed3fc..ad0de4cd4 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -680,6 +680,12 @@ def from_sam(cls, sam_result: list[dict]) -> Detections: xyxy = xywh_to_xyxy(xywh=xywh) return cls(xyxy=xyxy, mask=mask) + @classmethod + def from_samurai(cls, samurai_result: list[dict]) -> Detections: + mask = samurai_result['out_binary_masks'] + xyxy = mask_to_xyxy(mask) + return cls(xyxy=xyxy, mask=mask) + @classmethod def from_azure_analyze_image( cls, azure_result: dict, class_map: dict[int, str] | None = None