This commit is contained in:
Glenn Jocher 2020-01-09 21:05:26 -08:00
parent 759d275017
commit 0219eb094e
1 changed files with 2 additions and 2 deletions

View File

@ -283,7 +283,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
# Rectangular Training https://github.com/ultralytics/yolov3/issues/232 # Rectangular Training https://github.com/ultralytics/yolov3/issues/232
if self.rect: if self.rect:
# Read image shapes # Read image shapes (wh)
sp = path.replace('.txt', '.shapes') # shapefile path sp = path.replace('.txt', '.shapes') # shapefile path
try: try:
with open(sp, 'r') as f: # read existing shapefile with open(sp, 'r') as f: # read existing shapefile
@ -299,7 +299,7 @@ class LoadImagesAndLabels(Dataset): # for training/testing
i = ar.argsort() i = ar.argsort()
self.img_files = [self.img_files[i] for i in i] self.img_files = [self.img_files[i] for i in i]
self.label_files = [self.label_files[i] for i in i] self.label_files = [self.label_files[i] for i in i]
self.shapes = s[i] self.shapes = s[i] # wh
ar = ar[i] ar = ar[i]
# Set training image shapes # Set training image shapes