diff --git a/utils/datasets.py b/utils/datasets.py index c4f93f23..879d0d31 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -146,9 +146,9 @@ class LoadImagesAndLabels(Dataset): # for training/testing # Rectangular Training https://github.com/ultralytics/yolov3/issues/232 self.pad_rectangular = rect if self.pad_rectangular: + from PIL import Image bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index nb = bi[-1] + 1 # number of batches - from PIL import Image # Read image shapes sp = 'data' + os.sep + path.replace('.txt', '.shapes').split(os.sep)[-1] # shapefile path