From a81f24e08dc4da9df78e1e0aa2dd9d6cdbc20559 Mon Sep 17 00:00:00 2001 From: LinasKo Date: Wed, 19 Jun 2024 01:06:39 +0300 Subject: [PATCH] Explain OBB format in docstring --- supervision/dataset/core.py | 5 +++-- supervision/dataset/formats/yolo.py | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/supervision/dataset/core.py b/supervision/dataset/core.py index f2ad965c..e6d69f76 100644 --- a/supervision/dataset/core.py +++ b/supervision/dataset/core.py @@ -281,8 +281,9 @@ class DetectionDataset(BaseDataset): force_masks (bool, optional): If True, forces masks to be loaded for all annotations, regardless of whether they are present. - is_obb (bool, optional): If True, returns the - annotations in YOLO-OBB format. + is_obb (bool, optional): If True, loads the annotations in OBB format. + OBB annotations are defined as `[class_id, x, y, x, y, x, y, x, y]`, + where pairs of [x, y] are box corners. Returns: DetectionDataset: A DetectionDataset instance diff --git a/supervision/dataset/formats/yolo.py b/supervision/dataset/formats/yolo.py index 64ab84c9..f634d4fa 100644 --- a/supervision/dataset/formats/yolo.py +++ b/supervision/dataset/formats/yolo.py @@ -137,7 +137,9 @@ def load_yolo_annotations( YAML file containing class information. force_masks (bool, optional): If True, forces masks to be loaded for all annotations, regardless of whether they are present. - is_obb (bool, optional): If True, returns the annotations in YOLO-OBB format. + is_obb (bool, optional): If True, loads the annotations in OBB format. + OBB annotations are defined as `[class_id, x, y, x, y, x, y, x, y]`, + where pairs of [x, y] are box corners. Returns: Tuple[List[str], Dict[str, np.ndarray], Dict[str, Detections]]: