Skip to content

Commit

Permalink
Update dataloaders.py
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
  • Loading branch information
glenn-jocher authored Jun 30, 2024
1 parent 8dcca5b commit b3236fa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions utils/dataloaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,7 @@ def __init__(
rank=-1,
seed=0,
):
"""
Initializes the YOLOv5 dataset loader, handling images and their labels, caching, and preprocessing.
See https://docs.ultralytics.com/yolov5/tutorials/train_custom_data
"""
"""Initializes the YOLOv5 dataset loader, handling images and their labels, caching, and preprocessing."""
self.img_size = img_size
self.augment = augment
self.hyp = hyp
Expand Down Expand Up @@ -1357,7 +1353,7 @@ def create_classification_dataloader(
path, imgsz=224, batch_size=16, augment=True, cache=False, rank=-1, workers=8, shuffle=True
):
# Returns Dataloader object to be used with YOLOv5 Classifier
"""Creates a DataLoader for image classification, supporting caching, augmentation, and distributed training (https://docs.ultralytics.com/yolov5/tutorials/train_custom_data)."""
"""Creates a DataLoader for image classification, supporting caching, augmentation, and distributed training."""
with torch_distributed_zero_first(rank): # init dataset *.cache only once if DDP
dataset = ClassificationDataset(root=path, imgsz=imgsz, augment=augment, cache=cache)
batch_size = min(batch_size, len(dataset))
Expand Down

0 comments on commit b3236fa

Please sign in to comment.