Simplify augmentations (#93)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocher 2022-12-25 21:21:26 +01:00 committed by GitHub
parent 249dfbdc05
commit ae05d44877
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 68 deletions

View file

@ -1,7 +1,6 @@
from itertools import repeat
from multiprocessing.pool import Pool
from pathlib import Path
from typing import OrderedDict
import torchvision
from tqdm import tqdm
@ -126,7 +125,7 @@ class YOLODataset(BaseDataset):
def build_transforms(self, hyp=None):
if self.augment:
mosaic = self.augment and not self.rect
transforms = mosaic_transforms(self.imgsz, hyp) if mosaic else affine_transforms(self.imgsz, hyp)
transforms = mosaic_transforms(self, self.imgsz, hyp) if mosaic else affine_transforms(self.imgsz, hyp)
else:
transforms = Compose([LetterBox(new_shape=(self.imgsz, self.imgsz))])
transforms.append(