GIoU to default

This commit is contained in:
glenn-jocher 2019-07-07 23:42:24 +02:00
parent 2b863c3bf2
commit af3c5d0e35
1 changed files with 3 additions and 4 deletions

View File

@ -134,7 +134,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
def __init__(self, path, img_size=416, batch_size=16, augment=False, rect=True, image_weights=False): def __init__(self, path, img_size=416, batch_size=16, augment=False, rect=True, image_weights=False):
with open(path, 'r') as f: with open(path, 'r') as f:
img_files = f.read().splitlines() img_files = f.read().splitlines()
self.img_files = list(filter(lambda x: len(x) > 0, img_files)) self.img_files = [x for x in img_files if os.path.splitext(x)[-1].lower() in img_formats]
n = len(self.img_files) n = len(self.img_files)
bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index bi = np.floor(np.arange(n) / batch_size).astype(np.int) # batch index
@ -149,9 +149,8 @@ class LoadImagesAndLabels(Dataset): # for training/testing
self.rect = False if image_weights else rect self.rect = False if image_weights else rect
# Define labels # Define labels
self.label_files = [x.replace('images', 'labels') for x in self.img_files] self.label_files = [x.replace('images', 'labels').replace(os.path.splitext(x)[-1], '.txt')
for f in img_formats: for x in self.img_files]
self.label_files = [x.replace(f, '.txt') for x in self.label_files]
# Rectangular Training https://github.com/ultralytics/yolov3/issues/232 # Rectangular Training https://github.com/ultralytics/yolov3/issues/232
if self.rect: if self.rect: