From 186bfc44facca73b538e7cee10b9e29a149e28bf Mon Sep 17 00:00:00 2001 From: hd Date: Mon, 10 Jul 2023 18:03:56 +0200 Subject: [PATCH] paddledet initial support added --- supervision/detection/core.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index b423aaad..cee2ef5f 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -354,6 +354,14 @@ class Detections: return Detections(xyxy=xywh_to_xyxy(boxes_xywh=xywh), mask=mask) + @classmethod + def from_paddledet(cls, paddledet_result): + return cls( + xyxy=paddledet_result[:, 2:6], + confidence=paddledet_result[:, 1], + class_id=paddledet_result[:, 0].astype(int), + ) + @classmethod def empty(cls) -> Detections: """