ultralytics 8.0.160 Classify dataset scanning and caching (#4502)

This commit is contained in:
Glenn Jocher 2023-08-23 02:28:58 +02:00 committed by GitHub
parent b890e1c937
commit c7ceb84fb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 102 additions and 23 deletions

View file

@ -79,7 +79,7 @@ class ClassificationTrainer(BaseTrainer):
return ckpt
def build_dataset(self, img_path, mode='train', batch=None):
return ClassificationDataset(root=img_path, args=self.args, augment=mode == 'train')
return ClassificationDataset(root=img_path, args=self.args, augment=mode == 'train', prefix=mode)
def get_dataloader(self, dataset_path, batch_size=16, rank=0, mode='train'):
"""Returns PyTorch DataLoader with transforms to preprocess images for inference."""