This commit is contained in:
Glenn Jocher 2019-12-04 11:19:17 -08:00
parent 31b49cf870
commit d2a9cc662c
1 changed files with 11 additions and 11 deletions

View File

@ -576,19 +576,19 @@ def load_mosaic(self, index):
# Concat/clip labels # Concat/clip labels
if len(labels4): if len(labels4):
labels4 = np.concatenate(labels4, 0) labels4 = np.concatenate(labels4, 0)
# np.clip(labels4[:, 1:], 0, 2 * s, out=labels4[:, 1:]) # use before random_affine np.clip(labels4[:, 1:], 0, 2 * s, out=labels4[:, 1:]) # use before random_affine
np.clip(labels4[:, 1:], s / 2, 1.5 * s, out=labels4[:, 1:]) # np.clip(labels4[:, 1:], s / 2, 1.5 * s, out=labels4[:, 1:])
labels4[:, 1:] -= s / 2 # labels4[:, 1:] -= s / 2
img4 = img4[s // 2: int(s * 1.5), s // 2:int(s * 1.5)] # img4 = img4[s // 2: int(s * 1.5), s // 2:int(s * 1.5)]
# # Augment # Augment
# img4, labels4 = random_affine(img4, labels4, img4, labels4 = random_affine(img4, labels4,
# degrees=self.hyp['degrees'], degrees=self.hyp['degrees'],
# translate=self.hyp['translate'], translate=self.hyp['translate'],
# scale=self.hyp['scale'], scale=self.hyp['scale'],
# shear=self.hyp['shear'], shear=self.hyp['shear'],
# border=-s // 2) # border to remove border=-s // 2) # border to remove
return img4, labels4 return img4, labels4