From 823dc56057a6e0ae0887f4ce58eaab04ba9ee30a Mon Sep 17 00:00:00 2001 From: Seongjun Choi Date: Tue, 23 Jan 2024 15:14:56 +0900 Subject: [PATCH] Modify: from_mmdetection add mask. See #703 --- supervision/detection/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 39e129e1..9a284775 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -330,6 +330,9 @@ class Detections: xyxy=mmdet_results.pred_instances.bboxes.cpu().numpy(), confidence=mmdet_results.pred_instances.scores.cpu().numpy(), class_id=mmdet_results.pred_instances.labels.cpu().numpy().astype(int), + mask=mmdet_results.pred_instances.masks.cpu().numpy() + if 'masks' in mmdet_results.pred_instances + else None, ) @classmethod