From 2c235dfce9c205ef3cad1b20e7ed366cd8b82bdc Mon Sep 17 00:00:00 2001 From: Shadab Date: Sat, 3 Aug 2024 13:38:15 +0100 Subject: [PATCH] support of optional mask in convert_to_detections --- supervision/detection/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index eecfe2f4..fc0317fd 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -504,8 +504,8 @@ class Detections: """ return Detections( xyxy=processed_result["xyxy"], - mask=processed_result["mask"], - class_id=processed_result["class_id"], + mask=processed_result.get("mask"), + class_id=processed_result.get("class_id"), data=processed_result["data"], confidence=processed_result.get("confidence"), )