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]) """