This commit is contained in:
Glenn Jocher 2019-12-05 00:35:07 -08:00
parent 2421f3e252
commit 035faa6694
1 changed files with 1 additions and 1 deletions

View File

@ -508,7 +508,7 @@ def load_image(self, index):
img = cv2.imread(img_path) # BGR img = cv2.imread(img_path) # BGR
assert img is not None, 'Image Not Found ' + img_path assert img is not None, 'Image Not Found ' + img_path
r = self.img_size / max(img.shape) # resize image to img_size r = self.img_size / max(img.shape) # resize image to img_size
if (r < 1) or ((r > 1) and self.augment): # always resize down, only resize up if training with augmentation if self.augment and (r != 1): # always resize down, only resize up if training with augmentation
h, w = img.shape[:2] h, w = img.shape[:2]
return cv2.resize(img, (int(w * r), int(h * r)), interpolation=cv2.INTER_LINEAR) # _LINEAR fastest return cv2.resize(img, (int(w * r), int(h * r)), interpolation=cv2.INTER_LINEAR) # _LINEAR fastest
return img return img