From dc9b99214f78db7f80ac2ce43fff77557783552b Mon Sep 17 00:00:00 2001 From: Mohammed Yasin <32206511+Y-T-G@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:53:39 +0800 Subject: [PATCH] Fix v8_transforms docstring example (#17630) --- ultralytics/data/augment.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ultralytics/data/augment.py b/ultralytics/data/augment.py index 49bdc92235..d092e3c370 100644 --- a/ultralytics/data/augment.py +++ b/ultralytics/data/augment.py @@ -2280,7 +2280,7 @@ def v8_transforms(dataset, imgsz, hyp, stretch=False): Args: dataset (Dataset): The dataset object containing image data and annotations. imgsz (int): The target image size for resizing. - hyp (Dict): A dictionary of hyperparameters controlling various aspects of the transformations. + hyp (Namespace): A dictionary of hyperparameters controlling various aspects of the transformations. stretch (bool): If True, applies stretching to the image. If False, uses LetterBox resizing. Returns: @@ -2288,8 +2288,9 @@ def v8_transforms(dataset, imgsz, hyp, stretch=False): Examples: >>> from ultralytics.data.dataset import YOLODataset + >>> from ultralytics.utils import IterableSimpleNamespace >>> dataset = YOLODataset(img_path="path/to/images", imgsz=640) - >>> hyp = {"mosaic": 1.0, "copy_paste": 0.5, "degrees": 10.0, "translate": 0.2, "scale": 0.9} + >>> hyp = IterableSimpleNamespace(mosaic=1.0, copy_paste=0.5, degrees=10.0, translate=0.2, scale=0.9) >>> transforms = v8_transforms(dataset, imgsz=640, hyp=hyp) >>> augmented_data = transforms(dataset[0]) """