Fix v8_transforms docstring example (#17630)
This commit is contained in:
parent
121307a246
commit
dc9b99214f
1 changed files with 3 additions and 2 deletions
|
|
@ -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])
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue