From 55cd04d0aa4d69dde41d10b3e826bbc6c2b9a631 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 18 Apr 2023 12:26:51 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20small=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/dataset/core.py | 22 +++++++++++----------- supervision/dataset/formats/pascal_voc.py | 1 + 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/supervision/dataset/core.py b/supervision/dataset/core.py index c3450340..277d8e10 100644 --- a/supervision/dataset/core.py +++ b/supervision/dataset/core.py @@ -4,7 +4,7 @@ from typing import Dict, List, Optional import numpy as np from supervision.detection.core import Detections -from supervision.dataset.formats.pascal_voc import dataset_to_pascal_voc +# from supervision.dataset.formats.pascal_voc import dataset_to_pascal_voc @dataclass @@ -21,13 +21,13 @@ class Dataset: images: Dict[str, np.ndarray] annotations: Dict[str, Detections] - def as_pascal_voc( - self, - images_directory_path: Optional[str], - annotations_directory_path: Optional[str] - ) -> None: - dataset_to_pascal_voc( - detections=self, - images_directory_path=images_directory_path, - annotations_directory_path=annotations_directory_path - ) + # def as_pascal_voc( + # self, + # images_directory_path: Optional[str], + # annotations_directory_path: Optional[str] + # ) -> None: + # dataset_to_pascal_voc( + # detections=self, + # images_directory_path=images_directory_path, + # annotations_directory_path=annotations_directory_path + # ) diff --git a/supervision/dataset/formats/pascal_voc.py b/supervision/dataset/formats/pascal_voc.py index 2dc58b9b..a9696d6a 100644 --- a/supervision/dataset/formats/pascal_voc.py +++ b/supervision/dataset/formats/pascal_voc.py @@ -15,6 +15,7 @@ def detections_to_pascal_voc( ) -> str: """ Converts Detections object to Pascal VOC XML format. + Args: detections (Detections): A Detections object containing bounding boxes, class ids, and other relevant information. classes (List[str]): A list of class names corresponding to the class ids in the Detections object.