From 47f1c44e20550eae7c2949f167fa55a287ffee7f Mon Sep 17 00:00:00 2001 From: Bhavay Malhotra Date: Thu, 6 Jun 2024 22:20:41 +0530 Subject: [PATCH] Updated criteria for xyxyxyxy --- supervision/dataset/formats/yolo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index 40fc826b..d3ac870b 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -97,11 +97,12 @@ def yolo_annotations_to_detections( class_id = np.array(class_id, dtype=int) relative_xyxy = np.array(relative_xyxy, dtype=np.float32) - relative_xyxyxyxy = np.array(relative_xyxyxyxy, dtype=np.float32) xyxy = relative_xyxy * np.array([w, h, w, h], dtype=np.float32) - xyxyxyxy = relative_xyxyxyxy * np.array([w, h, w, h, w, h, w, h], dtype=np.float32) - - data = {ORIENTED_BOX_COORDINATES: xyxyxyxy} + + if is_obb: + relative_xyxyxyxy = np.array(relative_xyxyxyxy, dtype=np.float32) + xyxyxyxy = relative_xyxyxyxy * np.array([w, h, w, h, w, h, w, h], dtype=np.float32) + data = {ORIENTED_BOX_COORDINATES: xyxyxyxy} if not with_masks: if is_obb: