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()