From 251185ba677d152fdbaaabe9d3d67bbd9425dbf1 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Wed, 22 May 2024 19:48:39 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9E=20yolo=20obb=20hasstr=20add?= =?UTF-8?q?ed=20into=20condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- supervision/detection/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 0ba9e4f4..6563de7d 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -240,7 +240,7 @@ class Detections: Class names values can be accessed using `detections["class_name"]`. """ # noqa: E501 // docs - if "obb" in ultralytics_results and ultralytics_results.obb is not None: + if hasattr(ultralytics_results, "obb") and ultralytics_results.obb is not None: class_id = ultralytics_results.obb.cls.cpu().numpy().astype(int) class_names = np.array([ultralytics_results.names[i] for i in class_id]) oriented_box_coordinates = ultralytics_results.obb.xyxyxyxy.cpu().numpy()