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